Page templates messes up with the encoding of the title attribute in the ZMI
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Zope 2.10.5, Python 2.4.4
Summary: when the titles of folders and/or page templates contain non-ascii
caracters, weird things (unicode errors, incorrect display of strings...)
happen in the ZMI; the setting of the management_
some but not all of the problems.
Now let's go for the long version. I did the following:
1. create a new zope instance (mkzopeinstance
log in the ZMI;
2. give a title to the root folder containing non-ascii caracters;
3. try any action involving ZPT (create a new ZPT, access the error log, edit
/standard_
UnicodeDecod
4. set the management_
this point I have no more unicode errors when accessing the ZPT management
pages but I still have some problems:
- in the Properties tab of a ZPT I get a UnicodeDecodeError if I try to save
a title containing non-ascii caracters. Strangely enough this error is not
recorded in the event log, so I can't produce a traceback. If I try to set
the title from the Edit tab there is no problem.
- if the ZPT's title is ascii I can save the property sheet, but properties
having a non-ascii value are incorrectly displayed in the Properties
tab.
- if a folder has ZPT's and subfolders and if the titles of the subfolders
contain non-ascii caracters then the titles of the ZPT's are incorrectly
displayed in the folder Contents tab;
By "incorrectly displayed" I mean that the displayed string (value of the
property in the properties tab or title of the ZPT in the folder view) is
encoded as if it had been decoded from iso-8859-15, e.g. the word "étrange"
shows up as "étrange" (I checked that my browser (firefox) uses the right
encoding for displaying pages and for sending data in POST requests).
Outside the ZMI everything is fine: titles and properties are correctly encoded
and displayed in published pages.
I've unsuccesfully tried to reproduce (some of) these comportements in the
python interface (zopectl debug).
I've also tried to set the management_
are a bit better, in particular everything is displayed correctly but I still
can't save the title of a ZPT containing non-ascii caracters, neither from the
Edit nor from the Properties tab. Sometimes I also get an error when viewing
the Properties tab of a zpt, but I couldn't figure out what were the exact
conditions to reproduce it (see traceback).
I haven't played with the UnicodeEncoding
understand how it interacts with the rest; is there any place where I could
find some doc on this?
-------
Traceback obtained when the management_
containing folder (/) has a title containing non-ascii characters:
2008-03-09T13:35:50 ERROR Zope.SiteErrorLog http://
Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module Shared.
Module Shared.
Module Products.
Module Products.
Module zope.pagetempla
Module zope.tal.
Module zope.tal.
Module zope.tal.
Module zope.tal.
Module zope.tal.
Module zope.tal.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc9 in position 198: ordinal not in range(128)
-------
Traceback obtained when management_
to save a non-ascii title.
2008-03-09T15:34:29 ERROR Zope.SiteErrorLog http://
Traceback (innermost last):
Module ZPublisher.Publish, line 119, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 42, in call_object
Module Products.
Module Products.
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 4-6: invalid data
-------
Traceback that I occasionnaly obtain when management_
to iso-8859-15, but I can't figure out how to reproduce this error for sure.
2008-03-09T13:43:17 ERROR Zope.SiteErrorLog http://
ate.pt/
Traceback (innermost last):
Module ZPublisher.Publish, line 122, in publish
Module ZServer.
Module ZPublisher.
Module ZPublisher.
Module encodings.
UnicodeEncodeError: 'charmap' codec can't encode character u'\xa8' in position 11383: character maps to <undefined>
Changed in zope2: | |
status: | New → Confirmed |
The zope2 project on Launchpad has been archived at the request of the Zope developers (see https:/ /answers. launchpad. net/launchpad/ +question/ 683589 and https:/ /answers. launchpad. net/launchpad/ +question/ 685285). If this bug is still relevant, please refile it at https:/ /github. com/zopefoundat ion/zope2.