[zope2-tracker] [Bug 706946] [NEW] Saving a Page Template with a content-type except text/html or text/xml raises an exception in Zope-2.12

Kazuhiko 706946 at bugs.launchpad.net
Mon Jan 24 09:46:37 EST 2011


Public bug reported:

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.

** Affects: zope2
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Zope 2
Developers, which is subscribed to Zope 2.
https://bugs.launchpad.net/bugs/706946

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


More information about the zope2-tracker mailing list