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

Reported by Kazuhiko on 2011-01-24
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Zope 2
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.

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
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers