[Zope3-dev] [Fwd: [Z3d] 562/ 3 Reject "ObjectCopier must copy not reference the object"]

Egon Frerich e.frerich at nord-com.net
Wed Aug 23 05:34:15 EDT 2006


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

Hi,

here I am again.

On my PC I've changed zope\copypastemove\__init__.py (lines 396 - 403) from

>         checkObject(target, new_name, obj)
> 
>         chooser = INameChooser(target)
>         new_name = chooser.chooseName(new_name, obj)
> 
>         copy = locationCopy(obj)
>         copy.__parent__ = copy.__name__ = None
>         notify(ObjectCopiedEvent(copy, obj))

to

>         copy = locationCopy(obj)
>         copy.__parent__ = copy.__name__ = None
> 
>         checkObject(target, new_name, copy)
> 
>         chooser = INameChooser(target)
>         new_name = chooser.chooseName(new_name, copy)
> 
>         notify(ObjectCopiedEvent(copy, obj))

The tests passed. The problem 562 is gone.

Can somebody review this change?

@Philip:
I know there should be a test. But I'm not sure how to create the test
for this complicated issue. Maybe you can do it and I can learn from it.

And please have another look at my NameChooser function and give me an
explanation why you think "his logic in the namechooser seems bogus too"

Regards,

Egon


Egon Frerich schrieb am 2006-08-23 01:56:

> I assume I found the problem with the ObjectCopier. The ObjectCopier
> calls checkObject before copying the object with locationCopy. So I get
> in my NameChooser the original object not the copy.
> 
> Egon
> 
 [snip]
- --
Egon Frerich, Freudenbergstr. 16, 28213 Bremen

E-Mail: e.frerich at nord-com.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)
Comment: GnuPT 2.7.2
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE7CEQuTzybIiyjvURAhVFAKCUWB9AQlX65LVO0AmaicDj9pZcTwCfR+X8
MEC7HfMh9jg+/hFgjTklVVA=
=Imfe
-----END PGP SIGNATURE-----


More information about the Zope3-dev mailing list