Re: FW: Upgrade (to 0.9.2) fails with _p_jar

Guido Wesdorp <[email protected]>
Newsgroups gmane.comp.web.zope.silva.devel
Message-ID <[email protected]>
Benno Luthiger wrote:

>Dear JW
>
>I've tried your code completion. However, the upgrade fails on the next line
>:-( with:
>   print '_p_jar is None for', obj
>UnicodeError: ASCII encoding error: ordinal not in range(128)
>
>  
>
That's easy to fix: instead of 'obj' you can print 'repr(obj)', this 
will display non-ascii chars as escapes and makes printing possible no 
matter what the encoding of the string. I do think this does mean you're 
printing an object that has string content, though, so I reckon the 
output may not be too elegant, so perhaps it makes more sense to print:

print '_p_jar is None for', obj.absolute_url() 

or maybe

print '_p_jar is None for', '/'.join(obj.getPhysicalPath())

since not all objects have an absolute url (so through acquisition the absolute_url method of the parent will be called).

Good luck,

Guido
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.