[Grok-dev] Yet another UnicodeEncodeError

Sebastian Ware sebastian at urbantalk.se
Mon Oct 22 02:22:51 EDT 2007


I have encountered this problem as well.

   @grok.action(u'Som uppföljning...')

...doesn't work but...

   @grok.action(u'Som uppfoljning...')

...works. The source file is UTF-8 and the encoding is set. It fails  
during startup.

Mvh Sebastian

Traceback (most recent call last):
   File "/Users/jhsware/GrokProjects/Dynasales/parts/app/runzope",  
line 109, in ?
     zope.app.twisted.main.main()
   File "/Users/jhsware/buildout-eggs/tmp0jKJeV/ 
zope.app.twisted-3.4.0b1_r76119-py2.4.egg/zope/app/twisted/main.py",  
line 74, in main
   File "/Users/jhsware/buildout-eggs/tmp0jKJeV/ 
zope.app.twisted-3.4.0b1_r76119-py2.4.egg/zope/app/twisted/main.py",  
line 145, in setup
   File "/Users/jhsware/buildout-eggs/tmpZK493N/ 
zope.app.appsetup-3.4.0a1-py2.4.egg/zope/app/appsetup/appsetup.py",  
line 110, in config
   File "/Users/jhsware/buildout-eggs/tmpKSQ4aq/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/ 
xmlconfig.py", line 610, in file
   File "/Users/jhsware/buildout-eggs/tmpKSQ4aq/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/ 
xmlconfig.py", line 546, in include
   File "/Users/jhsware/buildout-eggs/tmpKSQ4aq/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/ 
xmlconfig.py", line 378, in processxmlfile
   File "/usr/local/lib/python2.4/xml/sax/expatreader.py", line 107,  
in parse
     xmlreader.IncrementalParser.parse(self, source)
   File "/usr/local/lib/python2.4/xml/sax/xmlreader.py", line 123, in  
parse
     self.feed(buffer)
   File "/usr/local/lib/python2.4/xml/sax/expatreader.py", line 207,  
in feed
     self._parser.Parse(data, isFinal)
   File "/usr/local/lib/python2.4/xml/sax/expatreader.py", line 348,  
in end_element_ns
     self._cont_handler.endElementNS(pair, None)
   File "/Users/jhsware/buildout-eggs/tmpKSQ4aq/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/ 
xmlconfig.py", line 357, in endElementNS
   File "/Users/jhsware/buildout-eggs/tmpKSQ4aq/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/config.py",  
line 542, in end
   File "/Users/jhsware/buildout-eggs/tmpKSQ4aq/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/config.py",  
line 690, in finish
   File "/Users/jhsware/buildout-eggs/tmpKSQ4aq/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/ 
xmlconfig.py", line 546, in include
   File "/Users/jhsware/buildout-eggs/tmpKSQ4aq/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/ 
xmlconfig.py", line 378, in processxmlfile
   File "/usr/local/lib/python2.4/xml/sax/expatreader.py", line 107,  
in parse
     xmlreader.IncrementalParser.parse(self, source)
   File "/usr/local/lib/python2.4/xml/sax/xmlreader.py", line 123, in  
parse
     self.feed(buffer)
   File "/usr/local/lib/python2.4/xml/sax/expatreader.py", line 207,  
in feed
     self._parser.Parse(data, isFinal)
   File "/usr/local/lib/python2.4/xml/sax/expatreader.py", line 348,  
in end_element_ns
     self._cont_handler.endElementNS(pair, None)
   File "/Users/jhsware/buildout-eggs/tmpKSQ4aq/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/ 
xmlconfig.py", line 357, in endElementNS
   File "/Users/jhsware/buildout-eggs/tmpKSQ4aq/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/config.py",  
line 542, in end
   File "/Users/jhsware/buildout-eggs/tmpKSQ4aq/ 
zope.configuration-3.4.0b1-py2.4.egg/zope/configuration/config.py",  
line 690, in finish
   File "/Users/jhsware/buildout-eggs/grok-0.10-py2.4.egg/grok/ 
zcml.py", line 33, in grokDirective
     grok.grok(package.__name__)
   File "/Users/jhsware/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/jhsware/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/jhsware/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/jhsware/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/jhsware/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/jhsware/buildout-eggs/martian-0.8.1-py2.4.egg/martian/ 
scan.py", line 116, in getModule
     self._module = resolve(self.dotted_name)
   File "/Users/jhsware/buildout-eggs/martian-0.8.1-py2.4.egg/martian/ 
scan.py", line 154, in resolve
     __import__(used)
   File "/Users/jhsware/GrokProjects/Dynasales/src/dynasales/ 
saleslead.py", line 208, in ?
     class HistoryWidget(grok.AddForm, protonbase.ProtonEdit):
   File "/Users/jhsware/GrokProjects/Dynasales/src/dynasales/ 
saleslead.py", line 214, in HistoryWidget
     @grok.action(u'Som uppföljning...')
   File "/Users/jhsware/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/jhsware/buildout-eggs/tmpuWvQE0/zope.formlib-3.4.0a1- 
py2.4.egg/zope/formlib/form.py", line 570, in __init__
   File "/usr/local/lib/python2.4/encodings/hex_codec.py", line 24,  
in hex_encode
     output = binascii.b2a_hex(input)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/Users/ 
jhsware/GrokProjects/Dynasales/parts/app/site.zcml", line 4.0-4.31
     ZopeXMLConfigurationError: File "/Users/jhsware/GrokProjects/ 
Dynasales/src/dynasales/configure.zcml", line 4.2-4.27
     UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6'  
in position 8: ordinal not in range(128)


21 okt 2007 kl. 19.18 skrev Jan Ulrich Hasecke:

> 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.
>
> juh
> _______________________________________________
> Grok-dev mailing list
> Grok-dev at zope.org
> http://mail.zope.org/mailman/listinfo/grok-dev



More information about the Grok-dev mailing list