Saving a Page Template with a content-type except text/html or text/xml raises an exception in Zope-2.12

Bug #706946 reported by Kazuhiko
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Medium
Unassigned

Bug Description

Hello,

* create a Page Template
* modify Content-Type to something except 'text/html' or 'text/xml', i.e. 'application/xml' for example.
* then we get an exception

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 Products.PageTemplates.ZopePageTemplate, line 198, in pt_editAction
  Module Products.PageTemplates.ZopePageTemplate, line 163, in pt_edit
  Module Products.PageTemplates.utils, line 81, in convertToUnicode
TypeError: decoding Unicode is not supported

This is because Products.PageTemplates.utils.convertToUnicode try to call unicode(source) even if source is already unicode (not str).

I attach the patch for svn://svn.zope.org/repos/main/Zope/branches/2.12/src/Products/PageTemplates that tests and fixes this issue.

Revision history for this message
Kazuhiko (kazuhiko) wrote :
summary: Saving a Page Template with a content-type except text/html or text/xml
- raises an exception
+ raises an exception in Zope-2.12
Changed in zope2:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Colin Watson (cjwatson) wrote :

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/zopefoundation/zope2.

Changed in zope2:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.