[Grok-dev] Re: Yet another UnicodeEncodeError

Jan Ulrich Hasecke janulrich.hasecke at web.de
Sun Oct 21 15:49:21 EDT 2007


Am 21.10.2007 um 21:19 schrieb Philipp von Weitershausen:

> Jan Ulrich Hasecke wrote:
>> Hi,
>>             @grok.action(_(u'Tiere füttern'))
>> in an AddForm gives:
>>  UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc'  
>> in position 7: ordinal not in range(128)
>> But "Tiere fuettern" on a button  looks ugly.
>
> Did you declare a source code encoding at the top of the file?
>
Yes.

# -*- coding: utf-8 -*-


> Please include a full traceback.
>

Macintosh-2:~/GrokZoo juh$ ./bin/zopectl fg
/Users/juh/GrokZoo/parts/app/runzope -C /Users/juh/GrokZoo/parts/ 
zopectl/zope.conf
Traceback (most recent call last):
   File "/Users/juh/GrokZoo/parts/app/runzope", line 110, in ?
     zope.app.twisted.main.main()
   File "/Users/juh/buildout-eggs/tmp_JdxsP/ 
zope.app.twisted-3.4.0b1_r76119-py2.4.egg/zope/app/twisted/main.py",  
line 74, in main
   File "/Users/juh/buildout-eggs/tmp_JdxsP/ 
zope.app.twisted-3.4.0b1_r76119-py2.4.egg/zope/app/twisted/main.py",  
line 145, in setup
   File "/Users/juh/buildout-eggs/tmpNn-RO6/zope.app.appsetup-3.4.0a1- 
py2.4.egg/zope/app/appsetup/appsetup.py", line 110, in config
   File "/Users/juh/buildout-eggs/tmpSiL1m9/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/ 
xmlconfig.py", line 610, in file
   File "/Users/juh/buildout-eggs/tmpSiL1m9/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/ 
xmlconfig.py", line 546, in include
   File "/Users/juh/buildout-eggs/tmpSiL1m9/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/ 
xmlconfig.py", line 378, in processxmlfile
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/xml/sax/expatreader.py", line 107, in parse
     xmlreader.IncrementalParser.parse(self, source)
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/xml/sax/xmlreader.py", line 123, in parse
     self.feed(buffer)
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/xml/sax/expatreader.py", line 207, in feed
     self._parser.Parse(data, isFinal)
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/xml/sax/expatreader.py", line 348, in end_element_ns
     self._cont_handler.endElementNS(pair, None)
   File "/Users/juh/buildout-eggs/tmpSiL1m9/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/ 
xmlconfig.py", line 357, in endElementNS
   File "/Users/juh/buildout-eggs/tmpSiL1m9/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/config.py",  
line 542, in end
   File "/Users/juh/buildout-eggs/tmpSiL1m9/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/config.py",  
line 690, in finish
   File "/Users/juh/buildout-eggs/tmpSiL1m9/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/ 
xmlconfig.py", line 546, in include
   File "/Users/juh/buildout-eggs/tmpSiL1m9/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/ 
xmlconfig.py", line 378, in processxmlfile
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/xml/sax/expatreader.py", line 107, in parse
     xmlreader.IncrementalParser.parse(self, source)
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/xml/sax/xmlreader.py", line 123, in parse
     self.feed(buffer)
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/xml/sax/expatreader.py", line 207, in feed
     self._parser.Parse(data, isFinal)
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/xml/sax/expatreader.py", line 348, in end_element_ns
     self._cont_handler.endElementNS(pair, None)
   File "/Users/juh/buildout-eggs/tmpSiL1m9/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/ 
xmlconfig.py", line 357, in endElementNS
   File "/Users/juh/buildout-eggs/tmpSiL1m9/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/config.py",  
line 542, in end
   File "/Users/juh/buildout-eggs/tmpSiL1m9/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/config.py",  
line 690, in finish
   File "/Users/juh/buildout-eggs/grok-0.10-py2.4.egg/grok/zcml.py",  
line 33, in grokDirective
     grok.grok(package.__name__)
   File "/Users/juh/buildout-eggs/grok-0.10-py2.4.egg/grok/_grok.py",  
line 81, in do_grok
     martian.grok_dotted_name(dotted_name, the_module_grokker)
   File "/Users/juh/buildout-eggs/martian-0.8.1-py2.4.egg/martian/ 
core.py", line 193, in grok_dotted_name
     grok_package(module_info, grokker, **kw)
   File "/Users/juh/buildout-eggs/martian-0.8.1-py2.4.egg/martian/ 
core.py", line 198, in grok_package
     grok_package(sub_module_info, grokker, **kw)
   File "/Users/juh/buildout-eggs/martian-0.8.1-py2.4.egg/martian/ 
core.py", line 196, in grok_package
     grok_module(module_info, grokker, **kw)
   File "/Users/juh/buildout-eggs/martian-0.8.1-py2.4.egg/martian/ 
core.py", line 201, in grok_module
     grokker.grok(module_info.dotted_name, module_info.getModule(),  
**kw)
   File "/Users/juh/buildout-eggs/martian-0.8.1-py2.4.egg/martian/ 
scan.py", line 116, in getModule
     self._module = resolve(self.dotted_name)
   File "/Users/juh/buildout-eggs/martian-0.8.1-py2.4.egg/martian/ 
scan.py", line 154, in resolve
     __import__(used)
   File "/Users/juh/GrokZoo/src/grokzoo/gehege.py", line 72, in ?
     class Tierfuettern(grok.AddForm):
   File "/Users/juh/GrokZoo/src/grokzoo/gehege.py", line 80, in  
Tierfuettern
     @grok.action(_(u'ÄÖÜ'))
   File "/Users/juh/buildout-eggs/grok-0.10-py2.4.egg/grok/ 
formlib.py", line 11, in __call__
     action = Action(self.label, success=success, **self.options)
   File "/Users/juh/buildout-eggs/tmpMNReCS/zope.formlib-3.4.0a1- 
py2.4.egg/zope/formlib/form.py", line 570, in __init__
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/encodings/hex_codec.py", line 24, in hex_encode
     output = binascii.b2a_hex(input)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/Users/ 
juh/GrokZoo/parts/app/site.zcml", line 4.0-4.29
     ZopeXMLConfigurationError: File "/Users/juh/GrokZoo/src/grokzoo/ 
configure.zcml", line 4.2-4.27
     UnicodeEncodeError: 'ascii' codec can't encode characters in  
position 0-2: ordinal not in range(128)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: Signierter Teil der Nachricht
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20071021/1aa95443/PGP.bin


More information about the Grok-dev mailing list