[Zope-dev] proxydict problems in 2.8b2 with Localizer
I get TypeError: object does not support item assignment in lin 46 och class_init.py. The offending code is d['_implicit__name__'] = 1 and this is because d is a proxydict. This in turn is caused by Localizer having a class as a class attribute: manage_attributesForm = LocalDTMLFile Apparently, Zope thinks that this class attribute needs a name, but there isn't one. This: manage_attributesForm._needs_name__ = 0 gets rid of the error, but I don't exactly like it. Can anybody shed some light on this, so I can figure out what would be The Right Thing to do? -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Zope 2.8b2 problems part 2: WingDBG and subtransactions.
WingDBG does this: tx = get_transaction().sub() That fails because 'Transaction' object has not attribute 'sub'. This is obviously an effect of the moving from subtransactions to checkpoints. Question: Is it Zope2.8 taht is wrong or WingDBG? -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Possible 2.8b2 bug part 3:
DateTime.DateTime.strftime(fmt) used to use strftime, which accepts a unicode string as fmt. In 2.8 it uses datetime.datetime.strftime which does not accept unicode. This both breaks backwards compatibility, and prevents you from using non-ascii characters in the format string. Thoughts, opinions? -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Possible 2.8b2 bug part 3:
--On Montag, 23. Mai 2005 19:22 Uhr +0200 Lennart Regebro [EMAIL PROTECTED] wrote: DateTime.DateTime.strftime(fmt) used to use strftime, which accepts a unicode string as fmt. In 2.8 it uses datetime.datetime.strftime which does not accept unicode. This both breaks backwards compatibility, and prevents you from using non-ascii characters in the format string hm...I am not sure if the time.strftime() implementation had been implemented with unicode format strings in mind. Accepting Unicode strings (maybe without checking them) appears to me more like an unintended accident than intentional behavior. I am pretty sure you can build a workaround easily. In my point of view the reason for the change (support for dates outside the usual 1970..2038 scope) is more important. Andreas pgpxlJdrO5Gcx.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Possible 2.8b2 bug part 3:
On 5/23/05, Andreas Jung [EMAIL PROTECTED] wrote: I am pretty sure you can build a workaround easily. In my point of view the reason for the change (support for dates outside the usual 1970..2038 scope) is more important. Well, I don't think we personally use any non-ascii characters, so we can work around it, but it does break backwards compatibility. We get an error when we use localize time and date strings, something I expect is pretty common, i.e., you translate a string medium_date_format with whatever translation tool you have, and then pass that as a date format. The translation tools will typically return unicode, and bam! it stops working. So, if we can't properly support unicode, I'd actually prefer that we cast the format string to string, perhaps with a deprecated warning if we pass unicode? -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] proxydict problems in 2.8b2 with Localizer
Lennart Regebro wrote at 2005-5-23 13:29 +0200: I get TypeError: object does not support item assignment in lin 46 och class_init.py. The offending code is d['_implicit__name__'] = 1 and this is because d is a proxydict. This in turn is caused by Localizer having a class as a class attribute: At other places, a similar problem could be solved by setattr(class, attr, value) instead of class.__dict__[attr] = value. -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Possible 2.8b2 bug part 3:
--On Montag, 23. Mai 2005 20:22 Uhr +0200 Lennart Regebro [EMAIL PROTECTED] wrote: The translation tools will typically return unicode, and bam! it stops working. So, if we can't properly support unicode, I'd actually prefer that we cast the format string to string, perhaps with a deprecated warning if we pass unicode? A deprecation warning could do the job. To be honest I would have never thought about such a usecase :-) However we could convert unicode to utf8 and use this as argument for strftime() and converting the result back to unicode. Andreas pgpX7OG2BmiST.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Possible 2.8b2 bug part 3:
On 5/23/05, Andreas Jung [EMAIL PROTECTED] wrote: A deprecation warning could do the job. To be honest I would have never thought about such a usecase :-) However we could convert unicode to utf8 and use this as argument for strftime() and converting the result back to unicode. Yeah, that works. Is there cases when this would not work? -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] proxydict problems in 2.8b2 with Localizer
On 5/23/05, Dieter Maurer [EMAIL PROTECTED] wrote: Lennart Regebro wrote at 2005-5-23 13:29 +0200: I get TypeError: object does not support item assignment in lin 46 och class_init.py. The offending code is d['_implicit__name__'] = 1 and this is because d is a proxydict. This in turn is caused by Localizer having a class as a class attribute: At other places, a similar problem could be solved by setattr(class, attr, value) instead of class.__dict__[attr] = value. I also succeeded in working around the problem by setting __name__ and _needs_name__ on the attribute in question, which feels better than my previous workaround. -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Possible 2.8b2 bug part 3:
--On Montag, 23. Mai 2005 20:40 Uhr +0200 Lennart Regebro [EMAIL PROTECTED] wrote: On 5/23/05, Andreas Jung [EMAIL PROTECTED] wrote: A deprecation warning could do the job. To be honest I would have never thought about such a usecase :-) However we could convert unicode to utf8 and use this as argument for strftime() and converting the result back to unicode. Yeah, that works. Is there cases when this would not work? utf8 should cover the whole unicode database, shouldn't it?! -aj pgph8RhC8lzC7.pgp Description: PGP signature ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )