This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: copy.py bug
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: anthonybaxter Nosy List: aleax, anthonybaxter, disommav, kbk, mwh
Priority: critical Keywords:

Created on 2005-02-02 14:43 by disommav, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)
msg24128 - (view) Author: Vincenzo Di Somma (disommav) Date: 2005-02-02 14:43
upgrading from python 2.3.4 to 2.3.5rc1 I got this
error on a module that was working correctly


  File "../Field.py", line 203, in copy
    properties = deepcopy(cdict)
  File "/usr/lib/python2.3/copy.py", line 191, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python2.3/copy.py", line 285, in
_deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python2.3/copy.py", line 200, in deepcopy
    copier = _getspecial(cls, "__deepcopy__")
  File "/usr/lib/python2.3/copy.py", line 66, in
_getspecial
    for basecls in cls.__mro__:
AttributeError: __mro__
msg24129 - (view) Author: Michael Hudson (mwh) (Python committer) Date: 2005-02-02 19:35
Logged In: YES 
user_id=6656

Eek, that sounds pretty bad!  Can you attach the code/cook up a smaller 
test case?
msg24130 - (view) Author: Anthony Baxter (anthonybaxter) (Python triager) Date: 2005-02-03 03:26
Logged In: YES 
user_id=29957

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=293338
has a fuller stack trace.
msg24131 - (view) Author: Alex Martelli (aleax) * (Python committer) Date: 2005-02-05 09:07
Logged In: YES 
user_id=60314

The problem's easy to fix (using inspect.getmro instead of direct 
__mro__ access) but hard to reproduce -- what type not recorded in the 
dispatch table lacks an __mro__?  Can't find one easily, and I'd like to 
have a unit-test reproducing the bug before I commit the fix.

Vincenzo, can you explain what the type is happening to be in that value 
whose deepcopy gives problems?  or can anybody else suggest a type as 
above?
msg24132 - (view) Author: Alex Martelli (aleax) * (Python committer) Date: 2005-02-06 07:57
Logged In: YES 
user_id=60314

Fixed (using inspect.getmro instead of direct __mro__ access) -- added 
unittest for that thanks to John Lenton's suggestion on c.l.py
msg24133 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2005-04-14 21:00
Logged In: YES 
user_id=149084

Should this be closed?
History
Date User Action Args
2022-04-11 14:56:09adminsetgithub: 41516
2005-02-02 14:43:24disommavcreate