python 2.4 support regression in clone_test_with_new_id

Bug #498030 reported by Robert Collins
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
testtools
Fix Released
Critical
Robert Collins

Bug Description

Traceback (most recent call last):
  File "C:\Python24\Lib\site-packages\testtools\runtest.py", line 128, in _run_user
    return fn(*args)
  File "C:\Python24\Lib\site-packages\testtools\testcase.py", line 368, in _run_test_method
    testMethod()
  File "C:\Python24\Lib\site-packages\testtools\tests\test_testtools.py", line 524, in test_clone_test_with_new_id
    newTest = clone_test_with_new_id(test, newName)
  File "C:\Python24\Lib\site-packages\testtools\testcase.py", line 381, in clone_test_with_new_id
    newTest = copy.deepcopy(test)
  File "C:\Python24\Lib\copy.py", line 204, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "C:\Python24\Lib\copy.py", line 351, in _reconstruct
    state = deepcopy(state, memo)
  File "C:\Python24\Lib\copy.py", line 174, in deepcopy
    y = copier(x, memo)
  File "C:\Python24\Lib\copy.py", line 268, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "C:\Python24\Lib\copy.py", line 174, in deepcopy
    y = copier(x, memo)
  File "C:\Python24\Lib\copy.py", line 241, in _deepcopy_list
    y.append(deepcopy(a, memo))
  File "C:\Python24\Lib\copy.py", line 174, in deepcopy
    y = copier(x, memo)
  File "C:\Python24\Lib\copy.py", line 248, in _deepcopy_tuple
    y.append(deepcopy(a, memo))
  File "C:\Python24\Lib\copy.py", line 204, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "C:\Python24\Lib\copy.py", line 336, in _reconstruct
    y = callable(*args)
  File "C:\Python24\Lib\copy_reg.py", line 92, in __newobj__
    return cls.__new__(cls, *args)
TypeError: function() takes at least 2 arguments (0 given)
------------

Revision history for this message
Robert Collins (lifeless) wrote :

The problem is that we now use function objects, and until
committer: guido.van.rossum
timestamp: Sat 2006-02-25 21:38:04 +0000
message:
  - Patch 1433928:
    - The copy module now "copies" function objects (as atomic objects).
    - dict.__getitem__ now looks for a __missing__ hook before raising
      KeyError.
    - Added a new type, defaultdict, to the collections module.
      This uses the new __missing__ hook behavior added to dict (see above).

they were not copyable.

I'm going to try monkey patching such support it.

Changed in testtools:
status: New → Triaged
importance: Undecided → Critical
assignee: nobody → Robert Collins (lifeless)
Changed in testtools:
milestone: none → next
status: Triaged → 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.