Public bug reported:
Binary package hint: zope3
When I attempt to run Zope3 with 'devmode' enabled, I get the following
traceback in 'transcript.log':
Traceback (most recent call last):
File "/var/lib/zope3/instance/sandbox/bin/runzope", line 48, in <module>
run()
File "/var/lib/zope3/instance/sandbox/bin/runzope", line 44, in run
main(["-C", CONFIG_FILE] + sys.argv[1:])
File "/usr/lib/python2.5/site-packages/zope/app/twisted/main.py", line 74, in
main
service = setup(load_options(args))
File "/usr/lib/python2.5/site-packages/zope/app/twisted/main.py", line 145,
in setup
zope.app.appsetup.config(options.site_definition, features=features)
File "/usr/lib/python2.5/site-packages/zope/app/appsetup/appsetup.py", line
111, in config
context = xmlconfig.file(file, context=context, execute=execute)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
610, in file
include(context, name, package)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
546, in include
processxmlfile(f, context)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
378, in processxmlfile
parser.parse(src)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.5/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 349, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
357, in endElementNS
self.context.end()
File "/usr/lib/python2.5/site-packages/zope/configuration/config.py", line
542, in end
self.stack.pop().finish()
File "/usr/lib/python2.5/site-packages/zope/configuration/config.py", line
690, in finish
actions = self.handler(context, **args)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
546, in include
processxmlfile(f, context)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
378, in processxmlfile
parser.parse(src)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.5/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 349, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
357, in endElementNS
self.context.end()
File "/usr/lib/python2.5/site-packages/zope/configuration/config.py", line
542, in end
self.stack.pop().finish()
File "/usr/lib/python2.5/site-packages/zope/configuration/config.py", line
690, in finish
actions = self.handler(context, **args)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
546, in include
processxmlfile(f, context)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
378, in processxmlfile
parser.parse(src)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.5/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 349, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
357, in endElementNS
self.context.end()
File "/usr/lib/python2.5/site-packages/zope/configuration/config.py", line
542, in end
self.stack.pop().finish()
File "/usr/lib/python2.5/site-packages/zope/configuration/config.py", line
690, in finish
actions = self.handler(context, **args)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
546, in include
processxmlfile(f, context)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
378, in processxmlfile
parser.parse(src)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.5/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 349, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
357, in endElementNS
self.context.end()
File "/usr/lib/python2.5/site-packages/zope/configuration/config.py", line
542, in end
self.stack.pop().finish()
File "/usr/lib/python2.5/site-packages/zope/configuration/config.py", line
690, in finish
actions = self.handler(context, **args)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
546, in include
processxmlfile(f, context)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
378, in processxmlfile
parser.parse(src)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.5/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 349, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
357, in endElementNS
self.context.end()
File "/usr/lib/python2.5/site-packages/zope/configuration/config.py", line
542, in end
self.stack.pop().finish()
File "/usr/lib/python2.5/site-packages/zope/configuration/config.py", line
690, in finish
actions = self.handler(context, **args)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
546, in include
processxmlfile(f, context)
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
378, in processxmlfile
parser.parse(src)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.5/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib/python2.5/xml/sax/expatreader.py", line 338, in
start_element_ns
AttributesNSImpl(newattrs, qnames))
File "/usr/lib/python2.5/site-packages/zope/configuration/xmlconfig.py", line
230, in startElementNS
self.context.begin(name, data, info)
File "/usr/lib/python2.5/site-packages/zope/configuration/config.py", line
539, in begin
self.stack.append(self.stack[-1].contained(__name, __data, __info))
File "/usr/lib/python2.5/site-packages/zope/configuration/config.py", line
840, in contained
return RootStackItem.contained(self, name, data, info)
File "/usr/lib/python2.5/site-packages/zope/configuration/config.py", line
711, in contained
adapter = factory(self.context, data, info)
File "/usr/lib/python2.5/site-packages/zope/configuration/config.py", line
1184, in factory
args = toargs(context, schema, data)
File "/usr/lib/python2.5/site-packages/zope/configuration/config.py", line
1381, in toargs
args[str(name)] = field.fromUnicode(s)
File "/usr/lib/python2.5/site-packages/zope/configuration/fields.py", line
139, in fromUnicode
value = self.context.resolve(name)
File "/usr/lib/python2.5/site-packages/zope/configuration/config.py", line
204, in resolve
return __import__(mname+'.'+oname, *_import_chickens)
File "/usr/lib/python2.5/site-packages/zope/testbrowser/__init__.py", line
20, in <module>
from testing import Browser
File "/usr/lib/python2.5/site-packages/zope/testbrowser/testing.py", line 25,
in <module>
import mechanize
File "/usr/lib/python2.5/site-packages/mechanize/__init__.py", line 86, in
<module>
from _mechanize import __version__
File "/usr/lib/python2.5/site-packages/mechanize/_mechanize.py", line 15, in
<module>
from _html import DefaultFactory
File "/usr/lib/python2.5/site-packages/mechanize/_html.py", line 321, in
<module>
RobustFormParser, NestingRobustFormParser = ClientForm._create_bs_classes(
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File
"/var/lib/zope3/instance/sandbox/etc/site.zcml", line 7.2-7.55
ZopeXMLConfigurationError: File
"/var/lib/zope3/instance/sandbox/etc/package-includes/apidoc-configure.zcml",
line 1.0-1.36
ZopeXMLConfigurationError: File
"/usr/lib/zope3/lib/python/zope/app/apidoc/configure.zcml", line 7.2-10.8
ZopeXMLConfigurationError: File
"/usr/lib/zope3/lib/python/zope/app/apidoc/enabled.zcml", line 92.2-92.35
ZopeXMLConfigurationError: File
"/usr/lib/zope3/lib/python/zope/app/apidoc/bookmodule/configure.zcml", line
47.2-47.30
ZopeXMLConfigurationError: File
"/usr/lib/zope3/lib/python/zope/app/apidoc/bookmodule/book.zcml", line 148.2
AttributeError: 'module' object has no attribute '_create_bs_classes'
... and Zope quits.
The exception indicates that it can't find a '_create_bs_classes'
attribute, which is a part of the 'ClientForm' module:
de...@development:/var/log/zope3/sandbox$ python2.5
Python 2.5.4 (r254:67916, Apr 4 2009, 17:55:16)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ClientForm
>>> ClientForm._create_bs_classes
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute '_create_bs_classes'
>>> dir(ClientForm)
['AmbiguityError', 'CheckboxControl', 'ClientForm', 'Control',
'ControlNotFoundError', 'FileControl', 'FormParser', 'HTMLForm',
'HiddenControl', 'IgnoreControl', 'ImageControl', 'IsindexControl', 'Item',
'ItemCountError', 'ItemNotFoundError', 'Label', 'ListControl', 'LocateError',
'Missing', 'ParseError', 'ParseFile', 'ParseFileEx', 'ParseResponse',
'ParseResponseEx', 'PasswordControl', 'RadioControl', 'ScalarControl',
'SelectControl', 'SubmitButtonControl', 'SubmitControl', 'TextControl',
'TextareaControl', 'XHTMLCompatibleFormParser', '__builtins__', '__doc__',
'__file__', '__name__', '__path__']
The function is actually in the 'ClientForm' submodule of the
'ClientForm' module:
>>> ClientForm.ClientForm._create_bs_classes
<function _create_bs_classes at 0x9a5b0d4>
The reason that the attribute is not imported into the main 'ClientForm'
module is because the main module uses a wildcard import:
from ClientForm import *
... which doesn't import attributes that begin with an underscore.
Now, this is where it gets really interesting.
The Zope3 package in Ubuntu is dependent on 'python-clientform', but the
'ClientForm' module that's imported by Zope3 that causes this error is
actually owned by the Zope3 package:
de...@development:/var/log/zope3/sandbox$ dpkg --search
/usr/lib/python2.5/site-packages/ClientForm/ClientForm.py
zope3: /usr/lib/python2.5/site-packages/ClientForm/ClientForm.py
... while the ClientForm.py in the root of the site-packages folder (a
link to /usr/share/pyshared/ClientForm.py) is owned by 'python-
clientform':
de...@development:/var/log/zope3/sandbox$ dpkg --search
/usr/share/pyshared/ClientForm.py
python-clientform: /usr/share/pyshared/ClientForm.py
So, the Zope3 package is dependent upon 'python-clientform', even though
it doesn't actually use it, and even breaks it for applications that use
the '_create_bs_classes' function (i.e. BeautifulSoup).
Incidentally, if the Zope3 package didn't provide its own 'ClientForm'
implementation and just used 'python-clientform', then this wouldn't be
a problem.
I'm using Ubuntu 9.04. Here's the package version information for
'zope3' and 'python-clientform':
de...@development:/var/log/zope3/sandbox$ apt-cache policy zope3
zope3:
Installed: 3.4.0-0ubuntu3
Candidate: 3.4.0-0ubuntu3
Version table:
*** 3.4.0-0ubuntu3 0
500 http://us.archive.ubuntu.com jaunty/main Packages
100 /var/lib/dpkg/status
de...@development:/var/log/zope3/sandbox$ apt-cache policy python-clientform
python-clientform:
Installed: 0.2.9-1ubuntu1
Candidate: 0.2.9-1ubuntu1
Version table:
*** 0.2.9-1ubuntu1 0
500 http://us.archive.ubuntu.com jaunty/main Packages
100 /var/lib/dpkg/status
I'm not sure if this bug should be directly reported to the Zope team,
as I didn't have this problem using 'devmode' in Ubuntu 8.10.
** Affects: zope3 (Ubuntu)
Importance: Undecided
Status: New
--
zope3 ClientForm errors in devmode
https://bugs.launchpad.net/bugs/423549
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs