-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Diaz, Eduardo wrote:
> Hello! I'm trying to run repoze.bfg on jython 2.5.1 without luck for now,
> I'm willing to fix what's needed for it to run...
> 
> So first let me describe what I've done.
> 
> I've installed setuptools on jython and followed tha installing repoze
> tutorial, virtualenv and easy_install -i
> http://dist.repoze.org/bfg/1.2/simple<http://dist.repoze.org/bfg/1.1/simple>
> repoze.bfg
> works fine, but I can't create the project with paster, this is the error
> message:
> 
> paster create -t bfg_starter
> Traceback (most recent call last):
 <snip>
>   File
> "/home/iamedu/Tests/jython/sys/Lib/site-packages/repoze.bfg-1.2a10-py2.5.egg/repoze/bfg/paster.py",
> line 68, in BFGShellCommand
>     usage = '\n' + __doc__
> TypeError: cannot concatenate 'str' and 'NoneType' objects

That appears to be an incompatibility between CPython and Jython.  In
CPython, the following works::

 $ ~/projects/Zope-CVS/bin/python2.5
 Python 2.5.4 (r254:67916, May 22 2009, 13:23:05)
 [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> print __doc__
 None
 >>> class Foo:
 ...     """ docstring """
 ...     usage = '\n' + __doc__
 ...
 >>> print Foo.usage

  docstring
 >>>

I'm guessint that the class statement blows up under Jython.

> I decided to continue my tests so I created the project with my python2.5
> and used that one. I deleted the MyProject.egg-info directory and ran:
> 
> jython setup.py egg_info
> 
> after that I ran:
> 
> jython setup.py develop
> 
> And to this point it works well, when I try to run the tests I get the
> following:
> 
>  jython setup.py test -qrunning test
> running egg_info
> writing MyProject.egg-info/PKG-INFO
> writing entry points to MyProject.egg-info/entry_points.txt
> writing requirements to MyProject.egg-info/requires.txt
> writing top-level names to MyProject.egg-info/top_level.txt
> writing dependency_links to MyProject.egg-info/dependency_links.txt
> reading manifest file 'MyProject.egg-info/SOURCES.txt'
> writing manifest file 'MyProject.egg-info/SOURCES.txt'
> running build_ext
> Traceback (most recent call last):
<snip>
> "/home/iamedu/Tests/jython/sys/Lib/site-packages/repoze.bfg-1.2a10-py2.5.egg/repoze/bfg/configuration.py",
> line 9, in <module>
>     from zope.configuration import xmlconfig
>   File
> "/home/iamedu/Tests/jython/sys/Lib/site-packages/zope.configuration-3.6.0-py2.5.egg/zope/configuration/xmlconfig.py",
> line 28, in <module>
>     import zope.configuration.config as config
>   File
> "/home/iamedu/Tests/jython/sys/Lib/site-packages/zope.configuration-3.6.0-py2.5.egg/zope/configuration/config.py",
> line 24, in <module>
>     import zope.schema
>   File
> "/home/iamedu/Tests/jython/sys/Lib/site-packages/zope.schema-3.5.4-py2.5.egg/zope/schema/__init__.py",
> line 18, in <module>
>     from zope.schema._field import Field, Container, Iterable, Orderable
>   File
> "/home/iamedu/Tests/jython/sys/Lib/site-packages/zope.schema-3.5.4-py2.5.egg/zope/schema/_field.py",
> line 31, in <module>
>     from zope.schema.interfaces import IField
>   File
> "/home/iamedu/Tests/jython/sys/Lib/site-packages/zope.schema-3.5.4-py2.5.egg/zope/schema/interfaces.py",
> line 233, in <module>
>     class IMinMaxLen(ILen):
>   File
> "/home/iamedu/Tests/jython/sys/Lib/site-packages/zope.schema-3.5.4-py2.5.egg/zope/schema/interfaces.py",
> line 236, in IMinMaxLen
>     min_length = Int(
>   File
> "/home/iamedu/Tests/jython/sys/Lib/site-packages/zope.schema-3.5.4-py2.5.egg/zope/schema/_bootstrapfields.py",
> line 382, in __init__
>     super(Int, self).__init__(*args, **kw)
>   File
> "/home/iamedu/Tests/jython/sys/Lib/site-packages/zope.schema-3.5.4-py2.5.egg/zope/schema/_bootstrapfields.py",
> line 231, in __init__
>     self.min = min
>   File
> "/home/iamedu/Tests/jython/sys/Lib/site-packages/zope.schema-3.5.4-py2.5.egg/zope/schema/_bootstrapfields.py",
> line 42, in __set__
>     inst.validate(value)
>   File
> "/home/iamedu/Tests/jython/sys/Lib/site-packages/zope.schema-3.5.4-py2.5.egg/zope/schema/_bootstrapfields.py",
> line 138, in validate
>     self._validate(value)
>   File
> "/home/iamedu/Tests/jython/sys/Lib/site-packages/zope.schema-3.5.4-py2.5.egg/zope/schema/_bootstrapfields.py",
> line 138, in validate
>     self._validate(value)
>   File
> "/home/iamedu/Tests/jython/sys/Lib/site-packages/zope.schema-3.5.4-py2.5.egg/zope/schema/_bootstrapfields.py",
> line 246, in _validate
>     raise TooBig(value, self.max)
> zope.schema._bootstrapinterfaces.TooBig: (0,
> <zope.schema._bootstrapfields.ValidatedProperty object at 0x2>)
> 
> And when running:
> 
> paster serve MyProject.ini
> 
> I get pretty much the same error message (it ends in the same)
> 
> Any ideas of what might be happening?
> 
> Thanks a lot for your time and help!

This appears to be an difference in how "partial" imports are handled
under CPython and Jython.  Does Jython have an equivalent to the '-i'
option under CPython?  I.e., stopping in the interpreter after running a
script::

 $ python -i some_script.py
 ...
 >>>

If so, you could run with it, and then examine the value shich is
provoking the error:

 $ jython -i setup.py develop
 <output and traceback elided>
 >>> import pdb; pdb.pm()
 (pdb) print value, self.max


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tsea...@palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAktCF8cACgkQ+gerLs4ltQ4I3QCffCwCCJzak5Sa5v9MwvpSAmGl
sf4AnjZm95LYmOCqgdlGxdfHMHBungJf
=Rh57
-----END PGP SIGNATURE-----
_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to