El error parece que sucede aquí al concatenar strings:

https://github.com/collective/sc.social.like/blob/master/sc/social/like/plugins/twitter/browser.py#L38

Puede que algún elemento que se concatene ahí sea 'unicode' en vez de
string. Sin embargo, tanto el absolute_url como el Title deberían ser
strings, por lo que me queda que el "twittvia" es unicode, pero no tiene
sentido al ser un setting del propio producto y debería ser string...

Pondría un PDB en esa línea que da error y comprobaría qué es cada cosa,
tiene que haber ahí algún elemento Unicode que al concatenar los strings
provoque el error.


Mikel



2013/11/13 Luis Feijoo <[email protected]>

> Es un Page Template.
> Abajo pongo el Traceback.
> Tipo de Excepción UnicodeDecodeErrorValor de la Excepción'ascii' codec
> can't decode byte 0xc3 in position 2: ordinal not in range(128)
>
> Traceback (innermost last):
>
>    - Module ZPublisher.Publish, line 127, in publish
>    - Module ZPublisher.mapply, line 77, in mapply
>    - Module ZPublisher.Publish, line 47, in call_object
>    - Module Shared.DC.Scripts.Bindings, line 324, in __call__
>    - Module Products.PloneHotfix20121106.python_scripts, line 63, in
>    _patched_bindAndExec
>    - Module Shared.DC.Scripts.Bindings, line 361, in _bindAndExec
>    - Module Products.CMFCore.FSPageTemplate, line 240, in _exec
>    - Module Products.CMFCore.FSPageTemplate, line 180, in pt_render
>    - Module Products.PageTemplates.PageTemplate, line 80, in pt_render
>    - Module zope.pagetemplate.pagetemplate, line 113, in pt_render
>    - Module zope.tal.talinterpreter, line 271, in __call__
>    - Module zope.tal.talinterpreter, line 343, in interpret
>    - Module zope.tal.talinterpreter, line 888, in do_useMacro
>    - Module zope.tal.talinterpreter, line 343, in interpret
>    - Module zope.tal.talinterpreter, line 533, in do_optTag_tal
>    - Module zope.tal.talinterpreter, line 518, in do_optTag
>    - Module zope.tal.talinterpreter, line 513, in no_tag
>    - Module zope.tal.talinterpreter, line 343, in interpret
>    - Module zope.tal.talinterpreter, line 852, in do_condition
>    - Module zope.tal.talinterpreter, line 343, in interpret
>    - Module zope.tal.talinterpreter, line 533, in do_optTag_tal
>    - Module zope.tal.talinterpreter, line 518, in do_optTag
>    - Module zope.tal.talinterpreter, line 513, in no_tag
>    - Module zope.tal.talinterpreter, line 343, in interpret
>    - Module zope.tal.talinterpreter, line 531, in do_optTag_tal
>    - Module zope.tal.talinterpreter, line 513, in no_tag
>    - Module zope.tal.talinterpreter, line 343, in interpret
>    - Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
>    - Module Products.PageTemplates.Expressions, line 220, in
>    evaluateStructure
>    - Module zope.tales.tales, line 696, in evaluate
>    *URL:
>    
> file:/opt/eduCommons-4.1.1/eggs/enpraxis.leftskin-2.3-py2.6.egg/enpraxis/leftskin/skins/leftskin/main_template.pt
>    <http://main_template.pt>*
>    *Line 49, Column 8*
>    *Expression: <StringExpr u'plone.htmlhead'>*
>    *Names:*
>
>    {'container': <PloneSite at /OCW>,
>     'context': <ATDocument at 
> /OCW/educacion-continua/computacion-basica/guia-de-aprendizaje>,
>     'default': <object object at 0xb76d95d8>,
>     'here': <ATDocument at 
> /OCW/educacion-continua/computacion-basica/guia-de-aprendizaje>,
>     'loop': {},
>     'nothing': None,
>     'options': {'args': ()},
>     'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 
> 0xb387370c>,
>     'request': <HTTPRequest, 
> URL=http://se.utpl.edu.ec:8080/OCW/educacion-continua/computacion-basica/guia-de-aprendizaje/document_view>,
>     'root': <Application at >,
>     'template': <FSPageTemplate at /OCW/document_view used for 
> /OCW/educacion-continua/computacion-basica/guia-de-aprendizaje>,
>     'traverse_subpath': [],
>     'user': <PropertiedUser 'admin'>}
>
>    - Module zope.contentprovider.tales, line 80, in __call__
>    - Module plone.app.viewletmanager.manager, line 85, in render
>    - Module Products.Five.browser.pagetemplatefile, line 126, in __call__
>    - Module Products.Five.browser.pagetemplatefile, line 60, in __call__
>    - Module zope.pagetemplate.pagetemplate, line 113, in pt_render
>    - Module zope.tal.talinterpreter, line 271, in __call__
>    - Module zope.tal.talinterpreter, line 343, in interpret
>    - Module zope.tal.talinterpreter, line 852, in do_condition
>    - Module zope.tal.talinterpreter, line 343, in interpret
>    - Module zope.tal.talinterpreter, line 533, in do_optTag_tal
>    - Module zope.tal.talinterpreter, line 518, in do_optTag
>    - Module zope.tal.talinterpreter, line 513, in no_tag
>    - Module zope.tal.talinterpreter, line 343, in interpret
>    - Module zope.tal.talinterpreter, line 819, in do_loop_tal
>    - Module zope.tales.tales, line 682, in setRepeat
>    - Module zope.tales.tales, line 696, in evaluate
>    *URL:
>    
> /opt/eduCommons-4.1.1/eggs/sc.social.like-2.0a2-py2.6.egg/sc/social/like/browser/templates/metadata.pt
>    <http://metadata.pt>*
>    *Line 2, Column 2*
>    *Expression: <PathExpr standard:u'view/plugins'>*
>    *Names:*
>
>    {'args': (),
>     'container': <ATDocument at 
> /OCW/educacion-continua/computacion-basica/guia-de-aprendizaje>,
>     'context': <ATDocument at 
> /OCW/educacion-continua/computacion-basica/guia-de-aprendizaje>,
>     'default': <object object at 0xb76d95d8>,
>     'here': <ATDocument at 
> /OCW/educacion-continua/computacion-basica/guia-de-aprendizaje>,
>     'loop': {},
>     'nothing': None,
>     'options': {},
>     'repeat': <Products.PageTemplates.Expressions.SafeMapping object at 
> 0xb383302c>,
>     'request': <HTTPRequest, 
> URL=http://se.utpl.edu.ec:8080/OCW/educacion-continua/computacion-basica/guia-de-aprendizaje/document_view>,
>     'root': <Application at >,
>     'template': <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile 
> object at 0xc46b84c>,
>     'traverse_subpath': [],
>     'user': <PropertiedUser 'admin'>,
>     'view': <Products.Five.viewlet.metaconfigure.SocialMetadataViewlet object 
> at 0xb3a0460c>,
>     'views': <Products.Five.browser.pagetemplatefile.ViewMapper object at 
> 0xb394d7cc>}
>
>    - Module zope.tales.expressions, line 217, in __call__
>    - Module Products.PageTemplates.Expressions, line 157, in _eval
>    - Module Products.PageTemplates.Expressions, line 119, in render
>    - Module sc.social.like.browser.viewlets, line 28, in plugins
>    - Module OFS.Traversable, line 310, in restrictedTraverse
>    - Module OFS.Traversable, line 201, in unrestrictedTraverse
>    __traceback_info__: ([], '@@twitter-plugin')
>    - Module zope.traversing.namespace, line 114, in namespaceLookup
>    - Module Products.PloneHotfix20121106.atat, line 14, in traverse
>    - Module zope.traversing.namespace, line 329, in traverse
>    - Module zope.component._api, line 122, in queryMultiAdapter
>    - Module zope.component.registry, line 240, in queryMultiAdapter
>    - Module zope.interface.adapter, line 522, in queryMultiAdapter
>    - Module sc.social.like.plugins.twitter.browser, line 41, in __init__
>
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 2:
> ordinal not in range(128)
>
>
> El 13 de noviembre de 2013 16:39, Mikel Larreategi <
> [email protected]> escribió:
>
> Yo no tocaría el sys.defaultencoding bajo ningún concepto:
>>
>>
>> http://blog.startifact.com/posts/older/changing-the-python-default-encoding-considered-harmful.html
>>
>> Pregunta para Luis:
>>
>> Péganos por favor el traceback completo. ¿dónde está ese texto? Tienes un
>> un Page Template o Python script el texto con las tildes?
>>
>>
>> Mikel
>>
>>
>> 2013/11/13 Leonardo Caballero <[email protected]>
>>
>>> Luis
>>>
>>> Si accedes al "Configuración del sitio  > Errores" acá
>>> http://localhost:8080/Plone/prefs_error_log_form allí debería parecer
>>> el error completo que estas reportando, es necesario analizar para saber
>>> que error específicamente tienes.
>>>
>>> Mas una posible opción es que habilites soporte a UTF-8 en la instancia
>>> Zope en tu configuracion buildout
>>>
>>> parts =
>>>     ...
>>>     instance-sitecustomize
>>>
>>> # This recipe help to enabled encoding to utf-8.
>>> # For options see http://pypi.python.org/pypi/collective.recipe.template
>>> [instance-sitecustomize]
>>> recipe = collective.recipe.template
>>> inline =
>>>     import sys
>>>     sys.setdefaultencoding('utf-8')
>>> output = ${instance:location}/sitecustomize.py
>>> mode = 644
>>>
>>> Reconstruyes el buildout y luego inicias tu instancia Zope ya deberías
>>> tener solventando este problema!
>>>
>>>
>>> 2013/11/13 Luis Feijoo <[email protected]>
>>>
>>>> si efectivamente ahí esta el error, y si estoy llamando a una función
>>>> decode...
>>>>
>>>>
>>>> El 13 de noviembre de 2013 13:05, Julio Jesús León Pérez <
>>>> [email protected]> escribió:
>>>>
>>>>> Tiene que ver con la tilde en "Educación". Ese string es unicode y al
>>>>> intentar pasarlo a una cadena normal, falla. Estás llamando a la función
>>>>> decode?
>>>>> El 13/11/2013 18:58, "Luis Feijoo" <[email protected]> escribió:
>>>>>
>>>>>>  buenos días ploneros al abrir una sección de Plone me aparece este
>>>>>> error:
>>>>>>
>>>>>> UnicodeDecodeError('ascii', 'Educaci\xc3\xb3n Continua - xxx ', 7, 8,
>>>>>> 'ordinal not in range(128)') (Also, the following error occurred while
>>>>>> attempting to render the standard error message, please see the event log
>>>>>> for full details: ('ascii', 'Educaci\xc3\xb3n Continua - xxxx', 7, 8,
>>>>>> 'ordinal not in range(128)'))
>>>>>>
>>>>>> Algun comentario de porquese produce y como puedo arreglarlo?
>>>>>>
>>>>>> --
>>>>>> Luis
>>>>>>
>>>>>> _______________________________________________
>>>>>> Usuarios-Plone mailing list
>>>>>> [email protected]
>>>>>> https://lists.plone.org/mailman/listinfo/plone-usuarios-plone
>>>>>>
>>>>>>
>>>>
>>>>
>>>> --
>>>> Luis
>>>>
>>>> _______________________________________________
>>>> Usuarios-Plone mailing list
>>>> [email protected]
>>>> https://lists.plone.org/mailman/listinfo/plone-usuarios-plone
>>>>
>>>>
>>>
>>>
>>> --
>>> Atentamente
>>>
>>> T.S.U. Leonardo Caballero
>>> Linux Counter ID = https://linuxcounter.net/user/369081.html
>>> Key fingerprint = 9FD2 DC71 38E7 A1D1 57F5  1D29 04DE 43BC 8A27 424A
>>>
>>> /me Corriendo Debian Wheezy y Canaina GNU/Linux 3
>>> /me Cree "El Conocimiento Humano le Pertenece al Mundo"
>>>
>>> _______________________________________________
>>> Usuarios-Plone mailing list
>>> [email protected]
>>> https://lists.plone.org/mailman/listinfo/plone-usuarios-plone
>>>
>>>
>>
>>
>> --
>> Mikel Larreategi
>> [email protected]
>>
>> CodeSyntax
>> Azitaingo Industrialdea 3 K
>> E-20600 Eibar
>> Tel: (+34) 943 82 17 80
>>
>> _______________________________________________
>> Usuarios-Plone mailing list
>> [email protected]
>> https://lists.plone.org/mailman/listinfo/plone-usuarios-plone
>>
>>
>
>
> --
> Luis
>



-- 
Mikel Larreategi
[email protected]

CodeSyntax
Azitaingo Industrialdea 3 K
E-20600 Eibar
Tel: (+34) 943 82 17 80
_______________________________________________
Usuarios-Plone mailing list
[email protected]
https://lists.plone.org/mailman/listinfo/plone-usuarios-plone

Responder a