[plonegov-br] UnicodeEncodeError em objeto de coleção

Joao Pedro dos Santos Thome joao.thome em unila.edu.br
Quinta Novembro 30 15:41:16 BRST 2017


Bom dia a todos! 

Ao clicar na aba de "Edição" de algumas coleções no meu portal acontece o seguinte erro: 

Traceback (innermost last):
  Module ZPublisher.Publish, line 138, in publish
  Module ZPublisher.mapply, line 77, in mapply
  Module ZPublisher.Publish, line 48, in call_object
  Module plone.z3cform.layout, line 66, in __call__
  Module plone.z3cform.layout, line 60, in update
  Module z3c.form.form, line 162, in render
  Module zope.browserpage.viewpagetemplatefile, line 51, in __call__
  Module zope.pagetemplate.pagetemplate, line 132, in pt_render
  Module five.pt.engine, line 93, in __call__
  Module z3c.pt.pagetemplate, line 163, in render
  Module chameleon.zpt.template, line 258, in render
  Module chameleon.template, line 171, in render
  Module c4937c80eeed276bf3ccb9e865f0192f, line 92, in render
  Module 527623d183bb990b03b0aa39f6147066, line 1801, in render_titlelessform
  Module 527623d183bb990b03b0aa39f6147066, line 452, in render_fields
  Module 527623d183bb990b03b0aa39f6147066, line 127, in render_widget_rendering
  Module 527623d183bb990b03b0aa39f6147066, line 1070, in render_field
  Module five.pt.expressions, line 161, in __call__
  Module Products.Five.browser.metaconfigure, line 485, in __call__
  Module zope.browserpage.viewpagetemplatefile, line 83, in __call__
  Module zope.browserpage.viewpagetemplatefile, line 51, in __call__
  Module zope.pagetemplate.pagetemplate, line 132, in pt_render
  Module five.pt.engine, line 93, in __call__
  Module z3c.pt.pagetemplate, line 163, in render
  Module chameleon.zpt.template, line 258, in render
  Module chameleon.template, line 171, in render
  Module 639a2083863065b1276cc5b401565501, line 591, in render
  Module 639a2083863065b1276cc5b401565501, line 466, in render_widget_wrapper
  Module five.pt.expressions, line 161, in __call__
  Module plone.formwidget.querystring.widget, line 24, in render
  Module zope.browserpage.viewpagetemplatefile, line 83, in __call__
  Module zope.browserpage.viewpagetemplatefile, line 51, in __call__
  Module zope.pagetemplate.pagetemplate, line 132, in pt_render
  Module five.pt.engine, line 93, in __call__
  Module z3c.pt.pagetemplate, line 163, in render
  Module chameleon.zpt.template, line 258, in render
  Module chameleon.template, line 191, in render
  Module chameleon.template, line 171, in render
  Module 195f89645856d61d371685d4bd97b6a1, line 648, in render
  Module encodings.utf_8, line 16, in decode
UnicodeEncodeError: 'ascii' codec can't encode character u'\xed' in position 3: ordinal not in range(128)

 - Expression: "widget/@@ploneform-render-widget"
 - Filename:   ... rm-0.7.7-py2.7.egg/plone/app/z3cform/templates/macros.pt
 - Location:   (line 97: col 81)
 - Source:     ... place="structure widget/@@ploneform-render-widget"/>
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 - Expression: "python:index.decode('utf-8')"
 - Filename:   ... ng-1.1.4-py2.7.egg/plone/formwidget/querystring/input.pt
 - Location:   (line 47: col 106)
 - Source:     ... cords:list'; value python:index.decode('utf-8');
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 - Arguments:  context: <ImplicitAcquisitionWrapper informes at 0x7f8967b05960>
               widget: <QueryStringWidget query at 0x7f895e7c99d0>
               repeat: {...} (0)
               sortable_indexes: {...} (15)
               views: <ViewMapper - at 0x7f895e309750>
               addindexselected: 0
               modules: <TraversableModuleImporter - at 0x7f8979e9cd90>
               args: <tuple - at 0x7f895e92e990>
               fieldName: form.widgets.query
               nothing: <NoneType - at 0x8fd4d0>
               row: {...} (3)
               index: Notícias SECOM 
               rows: <list - at 0x7f895d841098>
               target_language: pt_BR
               default: <object - at 0x7f8981024520>
               addoperatorselected: 0
               request: <instance - at 0x7f895e1ba680>
               wrapped_repeat: {...} (2)
               indexes: {...} (29)
               loop: {...} (2)
               template: <ViewPageTemplateFile - at 0x7f895e3096d0>
               translate: <function translate at 0x7f895ea016e0>
               config: {...} (3)
               options: {...} (0)
               view: <QueryStringWidget query at 0x7f895e7c99d0> 

Descobri agora que o mesmo acontece porque o nome da Seção que eu coloquei na configuração do NITF possúi acentuação, que no caso é "Notíciaas da SECOM". Ao tirar a acentuação funciona perfeitamente, alguém saberia de alguma maneira de fazer funcionar sem ter que tirar o acento? 



Att., 

João Pedro dos Santos Thomé | Técnico em Tecnologia da Informação 

Coordenadoria de Tecnologia da Informação - CTIC 

Divisão de Sistemas - DISIS 

-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://listas.interlegis.gov.br/pipermail/plonegov-br/attachments/20171130/cdac6a93/attachment.html>


Mais detalhes sobre a lista de discussão PloneGov-BR