Ticket #1895 (closed defect: fixed)

Opened 10 months ago

Last modified 10 months ago

UnicodeDecodeError when viewing a calendar if CPS site title has accented characters

Reported by: madarche Assigned to: lregebro
Priority: P2 Milestone: CPS 3.4.6
Component: CPSSharedCalendar Version: TRUNK
Severity: normal Keywords:
Cc:

Description (Last modified by madarche)

UnicodeDecodeError? when viewing a calendar if a CPS site has accented characters in its title.

    *  Module Products.PageTemplates.TALES, line 221, in evaluate
      URL: file:CPSDefault/skins/cps_default/header_lib_header.pt
      Line 18, Column 2
      Expression: standard:'expanded_title|here/expanded_title'
      Names:

      {'container': <Week at /cps/workspaces/calendriers/portes-ouvertes/week/2008/9>,
       'context': <Week at /cps/workspaces/calendriers/portes-ouvertes/week/2008/9>,
       'default': <Products.PageTemplates.TALES.Default instance at 0x4101d18c>,
       'here': <Week at /cps/workspaces/calendriers/portes-ouvertes/week/2008/9>,
       'loop': <Products.PageTemplates.TALES.SafeMapping object at 0x44061ecc>,
       'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x41043e0c>,
       'nothing': None,
       'options': {'args': (<Products.Five.metaclass.SimpleViewClass from /home/zope/cps/Products/CalZope/browser/week.pt object at 0x440614ec>,)},
       'repeat': <Products.PageTemplates.TALES.SafeMapping object at 0x44061ecc>,
       'request': <HTTPRequest, URL=http://madarche.demo.nuxeo.com/workspaces/calendriers/portes-ouvertes/week/2008/9/week.html>,
       'root': <Application at >,
       'template': <ImplicitAcquirerWrapper object at 0x4406152c>,
       'traverse_subpath': [],
       'user': <CPSUser manager>,
       'view': <Products.Five.metaclass.SimpleViewClass from /home/zope/cps/Products/CalZope/browser/week.pt object at 0x440614ec>,
       'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper object at 0x440617ac>}

    * Module Products.PageTemplates.Expressions, line 185, in __call__
    * Module Products.PageTemplates.Expressions, line 180, in _eval
    * Module Products.PageTemplates.Expressions, line 77, in render
    * Module Products.PageTemplates.ZRPythonExpr, line 76, in call_with_ns
    * Module Products.CMFCore.FSPythonScript, line 103, in __render_with_namespace__
    * Module Shared.DC.Scripts.Bindings, line 325, in __render_with_namespace__
    * Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
    * Module Products.CMFCore.FSPythonScript, line 164, in _exec
    * Module None, line 4, in expanded_title
      <FSPythonScript at /cps/expanded_title used for /cps/workspaces/calendriers/portes-ouvertes/week/2008/9>
      Line 4

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 9: 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' codec can't decode byte 0xe9 in position 9: ordinal not in range(128))

Change History

02/29/08 17:48:38 changed by madarche

The problem is that the calendar views are Unicode objects while the CPS site title in a string, and a Latin9 encoded string when the site title has accented characters.

02/29/08 17:49:51 changed by madarche

  • description changed.

02/29/08 18:03:10 changed by madarche

Fixed with changeset [52635].

The solution was to customize expanded_title.py. The customized file added in CPSDefault should be removed when the switch to UTF8 is done.

03/12/08 11:19:56 changed by madarche

  • status changed from new to closed.
  • resolution set to fixed.