collective / collective/funnelweb

TypeError: encode() argument 1 must be string without null bytes, not unicode

Open
#12 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Standard/bare Plone 4.0.3 buildout

Using latest funnelweb version (as of today) give me the following:

```
ajung@blackmoon:~/sandboxes/plone4> bin/funnelweb --crawler:url=file:///home/ajung/tmp/www.dahme-spreewald.de
Traceback (most recent call last):
File "bin/funnelweb", line 115, in
funnelweb.runner.runner({'ploneupload': {'target': 'http://admin:123@localhost:8080/Plone'}, 'crawler': {'url': 'file:///home/ajung/tmp/www.dahme-spreewald.de'}})
File "/home/ajung/.buildout/eggs/funnelweb-1.0b4-py2.6.egg/funnelweb/runner/__init__.py", line 89, in runner
zcml.load_config('configure.zcml', funnelweb)
File "/home/ajung/.buildout/eggs/Zope2-2.12.14-py2.6-linux-x86_64.egg/Products/Five/zcml.py", line 60, in load_config
_context = xmlconfig.file(file, package, _context, execute=execute)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py", line 647, in file
include(context, name, package)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py", line 546, in include
processxmlfile(f, context)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py", line 378, in processxmlfile
parser.parse(src)
File "/opt/python-2.6.4/lib/python2.6/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/opt/python-2.6.4/lib/python2.6/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/opt/python-2.6.4/lib/python2.6/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/opt/python-2.6.4/lib/python2.6/xml/sax/expatreader.py", line 349, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py", line 357, in endElementNS
self.context.end()
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py", line 537, in end
self.stack.pop().finish()
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py", line 685, in finish
actions = self.handler(context, **args)
File "/home/ajung/.buildout/eggs/z3c.autoinclude-0.3.2-py2.6.egg/z3c/autoinclude/zcml.py", line 104, in includePluginsDirective
includeZCMLGroup(_context, info, filename)
File "/home/ajung/.buildout/eggs/z3c.autoinclude-0.3.2-py2.6.egg/z3c/autoinclude/zcml.py", line 30, in includeZCMLGroup
include(_context, filename, includable_package)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py", line 546, in include
processxmlfile(f, context)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py", line 378, in processxmlfile
parser.parse(src)
File "/opt/python-2.6.4/lib/python2.6/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/opt/python-2.6.4/lib/python2.6/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/opt/python-2.6.4/lib/python2.6/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/opt/python-2.6.4/lib/python2.6/xml/sax/expatreader.py", line 349, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py", line 357, in endElementNS
self.context.end()
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py", line 537, in end
self.stack.pop().finish()
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py", line 684, in finish
args = toargs(context, *self.argdata)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py", line 1376, in toargs
args[str(name)] = field.fromUnicode(s)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/fields.py", line 139, in fromUnicode
value = self.context.resolve(name)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py", line 180, in resolve
mod = __import__(mname, *_import_chickens)
File "/home/ajung/.buildout/eggs/transmogrify.webcrawler-1.0b4-py2.6.egg/transmogrify/webcrawler/webcrawler.py", line 319, in
from lxml import etree
File "lxml.etree.pyx", line 89, in init lxml.etree (src/lxml/lxml.etree.c:141129)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/home/ajung/.buildout/eggs/funnelweb-1.0b4-py2.6.egg/funnelweb/configure.zcml", line 10.4-10.44
ZopeXMLConfigurationError: File "/home/ajung/.buildout/eggs/transmogrify.webcrawler-1.0b4-py2.6.egg/transmogrify/webcrawler/configure.zcml", line 12.4-13.46
TypeError: encode() argument 1 must be string without null bytes, not unicode
ajung@blackmoon:~/sandboxes/plone4> strace -f -oout bin/funnelweb --crawler:url=file:///home/ajung/tmp/www.dahme-spreewald.de
grep dahme out
Traceback (most recent call last):
File "bin/funnelweb", line 115, in
funnelweb.runner.runner({'ploneupload': {'target': 'http://admin:123@localhost:8080/Plone'}, 'crawler': {'url': 'file:///home/ajung/tmp/www.dahme-spreewald.de'}})
File "/home/ajung/.buildout/eggs/funnelweb-1.0b4-py2.6.egg/funnelweb/runner/__init__.py", line 89, in runner
zcml.load_config('configure.zcml', funnelweb)
File "/home/ajung/.buildout/eggs/Zope2-2.12.14-py2.6-linux-x86_64.egg/Products/Five/zcml.py", line 60, in load_config
_context = xmlconfig.file(file, package, _context, execute=execute)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py", line 647, in file
include(context, name, package)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py", line 546, in include
processxmlfile(f, context)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py", line 378, in processxmlfile
parser.parse(src)
File "/opt/python-2.6.4/lib/python2.6/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/opt/python-2.6.4/lib/python2.6/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/opt/python-2.6.4/lib/python2.6/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/opt/python-2.6.4/lib/python2.6/xml/sax/expatreader.py", line 349, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py", line 357, in endElementNS
self.context.end()
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py", line 537, in end
self.stack.pop().finish()
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py", line 685, in finish
actions = self.handler(context, **args)
File "/home/ajung/.buildout/eggs/z3c.autoinclude-0.3.2-py2.6.egg/z3c/autoinclude/zcml.py", line 104, in includePluginsDirective
includeZCMLGroup(_context, info, filename)
File "/home/ajung/.buildout/eggs/z3c.autoinclude-0.3.2-py2.6.egg/z3c/autoinclude/zcml.py", line 30, in includeZCMLGroup
include(_context, filename, includable_package)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py", line 546, in include
processxmlfile(f, context)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py", line 378, in processxmlfile
parser.parse(src)
File "/opt/python-2.6.4/lib/python2.6/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/opt/python-2.6.4/lib/python2.6/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/opt/python-2.6.4/lib/python2.6/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/opt/python-2.6.4/lib/python2.6/xml/sax/expatreader.py", line 349, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py", line 357, in endElementNS
self.context.end()
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py", line 537, in end
self.stack.pop().finish()
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py", line 684, in finish
args = toargs(context, *self.argdata)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py", line 1376, in toargs
args[str(name)] = field.fromUnicode(s)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/fields.py", line 139, in fromUnicode
value = self.context.resolve(name)
File "/home/ajung/.buildout/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py", line 180, in resolve
mod = __import__(mname, *_import_chickens)
File "/home/ajung/.buildout/eggs/transmogrify.webcrawler-1.0b4-py2.6.egg/transmogrify/webcrawler/webcrawler.py", line 319, in
from lxml import etree
File "lxml.etree.pyx", line 89, in init lxml.etree (src/lxml/lxml.etree.c:141129)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/home/ajung/.buildout/eggs/funnelweb-1.0b4-py2.6.egg/funnelweb/configure.zcml", line 10.4-10.44
ZopeXMLConfigurationError: File "/home/ajung/.buildout/eggs/transmogrify.webcrawler-1.0b4-py2.6.egg/transmogrify/webcrawler/configure.zcml", line 12.4-13.46
TypeError: encode() argument 1 must be string without null bytes, not unicode
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the command shown with bin/funnelweb and follow the traceback into transmogrify/webcrawler/webcrawler.py at line 319, where lxml.etree is imported. Inspect the related configure.zcml entries in funnelweb and transmogrify.webcrawler, then use the failing startup command to verify that configuration loading completes without the TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.