Property sheet interface and selection properties

Bug #143292 reported by Bug Importer
0
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Medium
Unassigned

Bug Description

1. create ZClass derived from DTMLDocument and ObjectManager
2. add a property sheet instance to the class
3. add some simple string properties
4. add a python script to the methods of this ZClass which returns a simple string array
5. add a selection property based on the script in 4.
6. try to add a property sheet interface to this property sheet instance

This runs into following error:

> Traceback (innermost last):
> Module ZPublisher.Publish, line 101, in publish
> Module ZPublisher.mapply, line 88, in mapply
> Module ZPublisher.Publish, line 39, in call_object
> Module ZClasses.Property, line 84, in manage_createView
> Module ZClasses.Property, line 188, in manage_createEditor
> Module ZClasses.Method, line 103, in manage_addDTMLMethod
> Module OFS.DTMLMethod, line 403, in addDTMLMethod
> AttributeError: 'unicode' object has no attribute 'read'

7. when removing the selection property all works fine

Tags: bug zope
Revision history for this message
Andreas Jung (ajung) wrote :

Try to replace in DTMLMethod.py, addDTMLMethod()

    if type(file) is not type(''): file=file.read()

with

    if not isinstance(file, (str, unicode)): file=file.read()

No idea where the unicode string in your case comes from. I think that 'file' should either be a file or a string but never a unicode string.

Please report back

Revision history for this message
Hanno Schlichting (hannosch) wrote :

This was an application bug and has a suggested fix. No bug in Zope itself in sight.

Changed in zope2:
status: New → 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.