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() no longer works on platform.uname_result objects
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jaraco Nosy List: jaraco, rocallahan
Priority: normal Keywords: patch

Created on 2020-10-29 01:53 by rocallahan, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 23010 merged jaraco, 2020-10-29 13:07
PR 24232 merged jaraco, 2021-01-16 19:22
Messages (4)
msg379853 - (view) Author: Robert O'Callahan (rocallahan) Date: 2020-10-29 01:53
Starting from Python 3.9, copy.deepcopy can't copy a platform.uname_result object.

```
Python 3.9.0 (default, Oct  6 2020, 00:00:00) 
[GCC 10.2.1 20200826 (Red Hat 10.2.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> import copy
>>> u = platform.uname()
>>> print(u)
uname_result(system='Linux', node='localhost.localdomain', release='5.8.16-300.fc33.x86_64', version='#1 SMP Mon Oct 19 13:18:33 UTC 2020', machine='x86_64')
>>> v = copy.deepcopy(u)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.9/copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/usr/lib64/python3.9/copy.py", line 264, in _reconstruct
    y = func(*args)
  File "/usr/lib64/python3.9/copyreg.py", line 91, in __newobj__
    return cls.__new__(cls, *args)
TypeError: <lambda>() takes 6 positional arguments but 7 were given
```

Looks similar to issue 42163 but I guess it might need to be fixed differently.

This has broken building Intel's Xed library, which uses a Python-based build system: https://github.com/intelxed/mbuild
msg379870 - (view) Author: Jason R. Coombs (jaraco) * (Python committer) Date: 2020-10-29 12:57
Acknowledged. Thanks for the report. I'll likely address this issue alongside the other (same PR).
msg384130 - (view) Author: Jason R. Coombs (jaraco) * (Python committer) Date: 2020-12-31 19:08
New changeset a6fd0f414c0cb4cd5cc20eb2df3340b31c6f7743 by Jason R. Coombs in branch 'master':
bpo-42163, bpo-42189, bpo-42659: Support uname_tuple._replace (for all but processor) (#23010)
https://github.com/python/cpython/commit/a6fd0f414c0cb4cd5cc20eb2df3340b31c6f7743
msg385147 - (view) Author: Jason R. Coombs (jaraco) * (Python committer) Date: 2021-01-16 19:45
New changeset 799722cb0ddb90752cde7798cab543f30623ebf2 by Jason R. Coombs in branch '3.9':
[3.9] bpo-42163, bpo-42189, bpo-42659: Support uname_tuple._replace (for all but processor) (GH-23010) (#24232)
https://github.com/python/cpython/commit/799722cb0ddb90752cde7798cab543f30623ebf2
History
Date User Action Args
2022-04-11 14:59:37adminsetgithub: 86355
2021-01-16 19:46:42jaracosetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-01-16 19:45:51jaracosetmessages: + msg385147
2021-01-16 19:22:28jaracosetpull_requests: + pull_request23056
2020-12-31 19:08:11jaracosetmessages: + msg384130
2020-10-29 13:07:18jaracosetkeywords: + patch
stage: patch review
pull_requests: + pull_request21945
2020-10-29 12:57:55jaracosetassignee: jaraco
messages: + msg379870
2020-10-29 09:55:09serhiy.storchakasetnosy: + jaraco
2020-10-29 01:53:35rocallahancreate