Re: [Zope-dev] Acquisition wrapped objects do not behave well on unicode call
On 2/20/11 1:32 AM, Christian Zagrodnick wrote: > On 2011-02-19 17:17:44 +0100, Hanno Schlichting said: > >> On Thu, Feb 17, 2011 at 8:27 AM, Christian Zagrodnick >> wrote: >>> On 2011-02-16 22:22:53 +0100, Hanno Schlichting said: > svn+ssh://svn.zope.org/repos/main/Acquisition/branches/zagy-unicode-should-be-called > Sure. I'll review, merge and release. Should be sometime this week, cannot promise a day. >> Branch reviewed, merged and released in Acquisition 2.13.6. >> >> Could you remove the merged branch once you updated your buildout config? > Done. > > Thanks for releasing! This change introduces a regression when calling unicode on wrapped objects that implement __str__ but not __unicode__. Essentially it is now doing the equivalent of str(aq_base(obj)) ... __str__ used to get a wrapped object as 'self', but now it is unwrapped. Here's a failing test that can be added to Acquisition's TestUnicode test case to demonstrate the issue: def test_str_fallback_is_still_wrapped(self): class A(Acquisition.Implicit): def __str__(self): return str(len(Acquisition.aq_chain(self))) wrapped = A().__of__(A()) self.assertEqual(u'2', unicode(wrapped)) This is currently causing some regressions in Plone tests. David -- David Glick Web Developer davidgl...@groundwire.org 206.286.1235x32 Groundwire: You Are Connected http://groundwire.org Online tools and strategies for the environmental movement. Sign up for Groundwire News! http://groundwire.org/email-capture ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] string exceptions
On Feb 25, 2011, at 6:38 AM, Hanno Schlichting wrote: > On Fri, Feb 25, 2011 at 12:32 PM, Charlie Clark > wrote: >> Am 25.02.2011, 12:26 Uhr, schrieb Hanno Schlichting : >>> +1 - if you really feel like it you could backport to 2.12 branch as >>> well (as it only supports Python 2.6 too). >> >> - 1 against backporting unless you are experiencing the errors on a 2.12 >> based system. > > Nobody experienced the problems yet, that's why it might be dead code. > > But the issue affects Zope 2.12 as much as 2.13 - both require a > minimum of Python 2.6, which doesn't support string exceptions > anymore. > > Hanno FWIW, I'm seeing this sort of error in the Plone 4.0 nightlies with Zope 2.12.16. > ... > File > "/Users/ems174/projects/plone4dev/src/Products.CMFCore/Products/CMFCore/MemberDataTool.py", > line 267, in getUser > raise 'MemberDataError', "Can't find user data" > TypeError: exceptions must be old-style classes or derived from > BaseException, not str Eric ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Zope Tests: 70 OK, 18 Failed
Summary of messages to the zope-tests list. Period Thu Feb 24 12:00:00 2011 UTC to Fri Feb 25 12:00:00 2011 UTC. There were 88 messages: 8 from Zope Tests, 4 from buildbot at pov.lt, 32 from buildbot at winbot.zope.org, 11 from ccomb at free.fr, 33 from jdriessen at thehealthagency.com. Test failures - Subject: FAILED : Zope Buildbot / zopetoolkit-1.1_win-py2.5 slave-win From: jdriessen at thehealthagency.com Date: Thu Feb 24 12:44:36 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033058.html Subject: FAILED : Zope 3.4 Known Good Set / py2.4-32bit-linux From: buildbot at pov.lt Date: Thu Feb 24 21:27:44 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033096.html Subject: FAILED : ZTK 1.0dev / Python2.4.6 Linux 64bit From: ccomb at free.fr Date: Thu Feb 24 22:12:02 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033101.html Subject: FAILED : ZTK 1.0dev / Python2.6.5 Linux 64bit From: ccomb at free.fr Date: Thu Feb 24 22:12:42 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033102.html Subject: FAILED : ZTK 1.0dev / Python2.5.5 Linux 64bit From: ccomb at free.fr Date: Thu Feb 24 22:12:52 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033103.html Subject: FAILED : winbot / z3c.form_py_265_32 From: buildbot at winbot.zope.org Date: Thu Feb 24 22:30:29 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033105.html Subject: FAILED : winbot / zope.app.container_py_265_32 From: buildbot at winbot.zope.org Date: Thu Feb 24 22:53:13 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033106.html Subject: FAILED : winbot / z3c.rml_py_265_32 From: buildbot at winbot.zope.org Date: Thu Feb 24 22:59:02 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033107.html Subject: FAILED : winbot / z3c.template_py_265_32 From: buildbot at winbot.zope.org Date: Thu Feb 24 23:07:52 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033109.html Subject: FAILED : winbot / z3c.layer.ready2go_py_265_32 From: buildbot at winbot.zope.org Date: Thu Feb 24 23:13:07 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033110.html Subject: FAILED : winbot / z3c.formui_py_265_32 From: buildbot at winbot.zope.org Date: Thu Feb 24 23:14:31 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033111.html Subject: FAILED : winbot / z3c.tabular_py_265_32 From: buildbot at winbot.zope.org Date: Thu Feb 24 23:16:41 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033112.html Subject: FAILED : winbot / z3c.contents_py_265_32 From: buildbot at winbot.zope.org Date: Thu Feb 24 23:17:36 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033113.html Subject: FAILED : winbot / z3c.ptcompat_py_265_32 From: buildbot at winbot.zope.org Date: Thu Feb 24 23:49:47 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033114.html Subject: FAILED : winbot / z3c.pdftemplate_py_265_32 From: buildbot at winbot.zope.org Date: Thu Feb 24 23:53:38 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033115.html Subject: FAILED : winbot / z3c.coverage_py_265_32 From: buildbot at winbot.zope.org Date: Thu Feb 24 23:55:03 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033116.html Subject: FAILED : winbot / z3c.macro_py_265_32 From: buildbot at winbot.zope.org Date: Thu Feb 24 23:55:49 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033117.html Subject: FAILED : winbot / z3c.pagelet_py_265_32 From: buildbot at winbot.zope.org Date: Fri Feb 25 00:01:04 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033118.html Tests passed OK --- Subject: OK : Zope Buildbot / zope2.12-py2.6 slave-ubuntu64 From: jdriessen at thehealthagency.com Date: Thu Feb 24 11:44:49 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033041.html Subject: OK : Zope Buildbot / zope2.13-py2.6 slave-ubuntu64 From: jdriessen at thehealthagency.com Date: Thu Feb 24 11:46:18 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033042.html Subject: OK : Zope Buildbot / zope2.13-py2.7 slave-ubuntu64 From: jdriessen at thehealthagency.com Date: Thu Feb 24 11:47:45 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033043.html Subject: OK : Zope Buildbot / zope2.14-py2.6 slave-ubuntu64 From: jdriessen at thehealthagency.com Date: Thu Feb 24 11:49:10 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033044.html Subject: OK : Zope Buildbot / zope2.14-py2.7 slave-ubuntu64 From: jdriessen at thehealthagency.com Date: Thu Feb 24 11:50:41 EST 2011 URL: http://mail.zope.org/pipermail/zope-tests/2011-February/033045.html Subject: OK : Zope Buildbot / zope2.13_win-py2.6 slave-win From: jdriessen at thehealthagency.com Date: Thu Feb 24 11:54:
Re: [Zope-dev] string exceptions
On Fri, Feb 25, 2011 at 12:32 PM, Charlie Clark wrote: > Am 25.02.2011, 12:26 Uhr, schrieb Hanno Schlichting : >> +1 - if you really feel like it you could backport to 2.12 branch as >> well (as it only supports Python 2.6 too). > > - 1 against backporting unless you are experiencing the errors on a 2.12 > based system. Nobody experienced the problems yet, that's why it might be dead code. But the issue affects Zope 2.12 as much as 2.13 - both require a minimum of Python 2.6, which doesn't support string exceptions anymore. Hanno ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] string exceptions
Am 25.02.2011, 12:26 Uhr, schrieb Hanno Schlichting : > +1 - if you really feel like it you could backport to 2.12 branch as > well (as it only supports Python 2.6 too). - 1 against backporting unless you are experiencing the errors on a 2.12 based system. Charlie -- Charlie Clark Managing Director Clark Consulting & Research German Office Helmholtzstr. 20 Düsseldorf D- 40215 Tel: +49-211-600-3657 Mobile: +49-178-782-6226 ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] string exceptions
On Fri, Feb 25, 2011 at 12:14 PM, Godefroid Chapelle wrote: > Where should those fixes happen ? > > 2.13 branch and trunk I suppose +1 - if you really feel like it you could backport to 2.12 branch as well (as it only supports Python 2.6 too). Hanno ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] string exceptions
On 25 February 2011 11:14, Godefroid Chapelle wrote: > Le 25/02/11 12:03, Hanno Schlichting a écrit : >>> I find a few string exceptions leftover in Zope 2.13 code. >>> > >>> > What practice has been followed until now regarding fixing those >>> > exceptions ? >> Just upgrade them to new-style exception classes. Since string >> exceptions cannot possibly work anymore, we cannot make things worse >> by fixing them. >> >> Hanno > > What about deciding to kill that code ? > > I guess it is a bit early because not enough people did migrate to 2.12 > or later. These statements now raise a TypeError instead of a string exceotion, which in most cases should be functionally equivalent. There's no guarantee that the code is dead. > Where should those fixes happen ? > > 2.13 branch and trunk I suppose This seems sensible. Laurence ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] string exceptions
On 25 February 2011 11:09, Godefroid Chapelle wrote: > Le 25/02/11 12:03, Laurence Rowe a écrit : >> >> On 25 February 2011 10:58, Godefroid Chapelle wrote: >>> >>> Hi, >>> >>> I find a few string exceptions leftover in Zope 2.13 code. >>> >>> However, they are not allowed anymore in Python 2.6. >>> >>> I guess that the remaining string exceptions are in dead/semidead code. >>> >>> What practice has been followed until now regarding fixing those >>> exceptions ? >> >> According to this doc, >> >> http://docs.python.org/c-api/exceptions.html#deprecation-of-string-exceptions >> >> "String exceptions are still supported in the interpreter to allow >> existing code to run unmodified, but this will also change in a future >> release." >> >> It will of course be important to fix these before we move to Python >> 3.x, but I would expect that the dead/semidead code will not be >> ported. >> >> Laurence > > I just tried to run the code hereunder with Python 2.6.5: > > def main(): > raise "Abc" > > main() > > This is what I get : > > Traceback (most recent call last): > File "test.py", line 4, in > main() > File "test.py", line 2, in main > raise "Abc" > TypeError: exceptions must be old-style classes or derived from > BaseException, not str > > I am not sure what the documentation above means but it seems to be text > that was not fixed... Reported in http://bugs.python.org/issue11317 Laurence ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] string exceptions
Le 25/02/11 12:03, Hanno Schlichting a écrit : >> I find a few string exceptions leftover in Zope 2.13 code. >> > >> > What practice has been followed until now regarding fixing those >> > exceptions ? > Just upgrade them to new-style exception classes. Since string > exceptions cannot possibly work anymore, we cannot make things worse > by fixing them. > > Hanno What about deciding to kill that code ? I guess it is a bit early because not enough people did migrate to 2.12 or later. Where should those fixes happen ? 2.13 branch and trunk I suppose -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] string exceptions
Le 25/02/11 12:03, Laurence Rowe a écrit : > On 25 February 2011 10:58, Godefroid Chapelle wrote: >> Hi, >> >> I find a few string exceptions leftover in Zope 2.13 code. >> >> However, they are not allowed anymore in Python 2.6. >> >> I guess that the remaining string exceptions are in dead/semidead code. >> >> What practice has been followed until now regarding fixing those >> exceptions ? > > According to this doc, > http://docs.python.org/c-api/exceptions.html#deprecation-of-string-exceptions > > "String exceptions are still supported in the interpreter to allow > existing code to run unmodified, but this will also change in a future > release." > > It will of course be important to fix these before we move to Python > 3.x, but I would expect that the dead/semidead code will not be > ported. > > Laurence I just tried to run the code hereunder with Python 2.6.5: def main(): raise "Abc" main() This is what I get : Traceback (most recent call last): File "test.py", line 4, in main() File "test.py", line 2, in main raise "Abc" TypeError: exceptions must be old-style classes or derived from BaseException, not str I am not sure what the documentation above means but it seems to be text that was not fixed... -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] string exceptions
On 25 February 2011 11:03, Laurence Rowe wrote: > On 25 February 2011 10:58, Godefroid Chapelle wrote: >> Hi, >> >> I find a few string exceptions leftover in Zope 2.13 code. >> >> However, they are not allowed anymore in Python 2.6. >> >> I guess that the remaining string exceptions are in dead/semidead code. >> >> What practice has been followed until now regarding fixing those >> exceptions ? > > According to this doc, > http://docs.python.org/c-api/exceptions.html#deprecation-of-string-exceptions > > "String exceptions are still supported in the interpreter to allow > existing code to run unmodified, but this will also change in a future > release." > > It will of course be important to fix these before we move to Python > 3.x, but I would expect that the dead/semidead code will not be > ported. I take that back, that documentation is incorrect, they have indeed stopped working. Laurence ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] string exceptions
On 25 February 2011 10:58, Godefroid Chapelle wrote: > Hi, > > I find a few string exceptions leftover in Zope 2.13 code. > > However, they are not allowed anymore in Python 2.6. > > I guess that the remaining string exceptions are in dead/semidead code. > > What practice has been followed until now regarding fixing those > exceptions ? According to this doc, http://docs.python.org/c-api/exceptions.html#deprecation-of-string-exceptions "String exceptions are still supported in the interpreter to allow existing code to run unmodified, but this will also change in a future release." It will of course be important to fix these before we move to Python 3.x, but I would expect that the dead/semidead code will not be ported. Laurence ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] string exceptions
Hi. On Fri, Feb 25, 2011 at 11:58 AM, Godefroid Chapelle wrote: > I find a few string exceptions leftover in Zope 2.13 code. > > What practice has been followed until now regarding fixing those > exceptions ? Just upgrade them to new-style exception classes. Since string exceptions cannot possibly work anymore, we cannot make things worse by fixing them. Hanno ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] string exceptions
Hi, I find a few string exceptions leftover in Zope 2.13 code. However, they are not allowed anymore in Python 2.6. I guess that the remaining string exceptions are in dead/semidead code. What practice has been followed until now regarding fixing those exceptions ? Regards -- Godefroid Chapelle (aka __gotcha) http://bubblenet.be ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )