CopySupport defines a STRING exception

Bug #373299 reported by auspex
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope 2
Fix Released
Undecided
Tres Seaver

Bug Description

Zope 2.10.6-final

In OFS/CopySupport.py, CopyError is a string exception - long deprecated in Python. It should be a class derived from Exception, and here's a patch:

$ diff -u CopySupport.py*
--- CopySupport.py 2009-05-07 11:55:30.299870897 -0300
+++ CopySupport.py~ 2009-05-07 11:55:13.899869712 -0300
@@ -48,8 +48,7 @@
 from OFS.interfaces import ICopySource

-class CopyError(Exception): pass
-
+CopyError='Copy Error'

 copy_re = re.compile('^copy([0-9]*)_of_(.*)')

Revision history for this message
auspex (auspex) wrote :

Damn. Except for the fact that I got the patch backwards _again_!

--- CopySupport.py~ 2009-05-07 11:55:13.899869712 -0300
+++ CopySupport.py 2009-05-07 11:55:30.299870897 -0300
@@ -48,7 +48,8 @@
 from OFS.interfaces import ICopySource

-CopyError='Copy Error'
+class CopyError(Exception): pass
+

 copy_re = re.compile('^copy([0-9]*)_of_(.*)')

Revision history for this message
Tres Seaver (tseaver) wrote : Re: [Bug 373299] Re: CopySupport defines a STRING exception

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

auspex wrote:
> Damn. Except for the fact that I got the patch backwards _again_!
>
> --- CopySupport.py~ 2009-05-07 11:55:13.899869712 -0300
> +++ CopySupport.py 2009-05-07 11:55:30.299870897 -0300
> @@ -48,7 +48,8 @@
> from OFS.interfaces import ICopySource
>
>
> -CopyError='Copy Error'
> +class CopyError(Exception): pass
> +
>
> copy_re = re.compile('^copy([0-9]*)_of_(.*)')
>

 status inprogress
 assignee tseaver

- --
===================================================================
Tres Seaver +1 540-429-0999 <email address hidden>
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKAwfq+gerLs4ltQ4RAlDiAJ9hZt1h7KlE+sKZGfg/ja0H2UGxhQCcC8k5
JfkKx2jARTtj31UFRm0V79k=
=EouY
-----END PGP SIGNATURE-----

Changed in zope2:
assignee: nobody → Tres Seaver (tseaver)
status: New → In Progress
Revision history for this message
Tres Seaver (tseaver) wrote : Re: [Bug 373299] [NEW] CopySupport defines a STRING exception

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

 status fixcommitted

Fixed on 2.9, 2.10, and 2.11 branches. See:

 - http://svn.zope.org/Zope/branches/2.9/?rev=99799&view=rev

 - http://svn.zope.org/Zope/branches/2.10/?rev=99797&view=rev

 - http://svn.zope.org/Zope/branches/2.11/?rev=99798&view=rev

The trunk was already fixed in order to be compatible with Python 2.6.

Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 <email address hidden>
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKAwrc+gerLs4ltQ4RAojJAJ9jYRpUyi61tsv7Oej9xryPhIcUMACgnzGL
V3t6poHVQbIad5MWu4uLUoI=
=bn2a
-----END PGP SIGNATURE-----

Changed in zope2:
status: In Progress → Fix Committed
Changed in zope2:
status: Fix Committed → Fix Released
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.