Bug 1223037
| Summary: | Python raises exception on deepcopy of instance methods | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | mulhern <amulhern> |
| Component: | python | Assignee: | Python Maintainers <python-maint> |
| Status: | CLOSED ERRATA | QA Contact: | Branislav Náter <bnater> |
| Severity: | urgent | Docs Contact: | |
| Priority: | urgent | ||
| Version: | 6.7 | CC: | amulhern, bnater, dcantrell, dkutalek, dlehman, mstuchli, ovasik, salmy, sbueno, tjeyasin, tlavigne, vtrefny |
| Target Milestone: | rc | ||
| Target Release: | 6.7 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | python-2.6.6-64.el6 | Doc Type: | Bug Fix |
| Doc Text: |
Cause: When using deepcopy on instance methods, a TypeError exception is thrown.
Consequence: An exception TypeError is thrown, when using deepcopy on instance methods.
Fix: Make deepcopy take shallow copies of functions and classes.
Result: Deepcopy is now usable on instance methods.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-07-22 06:40:23 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
mulhern
2015-05-19 16:17:49 UTC
Reproduced on python-2.6.6-52.el6:
:: [ BEGIN ] :: Run reproducer :: actually running 'python test.py'
Traceback (most recent call last):
File "test.py", line 5, in <module>
copy.deepcopy(an_id.get_bytes)
File "/usr/lib64/python2.6/copy.py", line 189, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib64/python2.6/copy.py", line 323, in _reconstruct
y = callable(*args)
File "/usr/lib64/python2.6/copy_reg.py", line 93, in __newobj__
return cls.__new__(cls, *args)
TypeError: instancemethod expected at least 2 arguments, got 0
:: [ FAIL ] :: Run reproducer (Expected 0, got 1)
Verified on python-2.6.6-64.el6:
:: [ BEGIN ] :: Run reproducer :: actually running 'python test.py'
:: [ PASS ] :: Run reproducer (Expected 0, got 0)
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2015-1330.html |