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.deepcopy exceptions.TypeError: 'NoneType' object ...
Type: Stage:
Components: None Versions:
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: arthur_lutz, ncoghlan
Priority: normal Keywords:

Created on 2004-10-06 10:35 by arthur_lutz, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg22597 - (view) Author: Arthur Lutz (arthur_lutz) Date: 2004-10-06 10:35
when using copy.deepcopy on certain objects I get
(after a large number 
of copier/_deepcopy_something):
 
filename="/usr/lib/python2.3/copy.py" line_number="179"
function_name="deepcopy"
    y = copier(x, memo)
filename="/usr/lib/python2.3/copy.py" line_number="250"
function_name="_deepcopy_tuple"
    y.append(deepcopy(a, memo))
filename="/usr/lib/python2.3/copy.py" line_number="179"
function_name="deepcopy"
    y = copier(x, memo)
filename="/usr/lib/python2.3/copy.py" line_number="270"
function_name="_deepcopy_dict"
    y[deepcopy(key, memo)] = deepcopy(value, memo)
filename="/usr/lib/python2.3/copy.py" line_number="179"
function_name="deepcopy"
    y = copier(x, memo)
filename="/usr/lib/python2.3/copy.py" line_number="243"
function_name="_deepcopy_list"
    y.append(deepcopy(a, memo))
filename="/usr/lib/python2.3/copy.py" line_number="206"
function_name="deepcopy"
    y = _reconstruct(x, rv, 1, memo)
filename="/usr/lib/python2.3/copy.py" line_number="353"
function_name="_reconstruct"
    state = deepcopy(state, memo)
filename="/usr/lib/python2.3/copy.py" line_number="179"
function_name="deepcopy"
    y = copier(x, memo)
filename="/usr/lib/python2.3/copy.py" line_number="270"
function_name="_deepcopy_dict"
    y[deepcopy(key, memo)] = deepcopy(value, memo)
filename="/usr/lib/python2.3/copy.py" line_number="198"
function_name="deepcopy"
    rv = reductor(2)
exceptions.TypeError: 'NoneType' object is not callable

Hope this is enough traceback
msg22598 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2004-10-06 15:32
Logged In: YES 
user_id=1038590

'Certain objects' is not very specific. Are these builtin
objects, or your own classes? (I would assume the latter)

Which version of Python 2.3 are you running? ("python -V"
will tell you if you don't already know)

Also, are you able to retry this with the latest Python 2.4
pre-release? It looks like it has changes which are relevant
(i.e there are guards before all of the reductor calls to
prevent the above exception).
msg22599 - (view) Author: Arthur Lutz (arthur_lutz) Date: 2004-10-06 15:37
Logged In: YES 
user_id=848508

Sorry,

The bug was indeed in one of my classes. 
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 40985
2004-10-06 10:35:59arthur_lutzcreate