Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy.deepcopy() no longer works on platform.uname_result objects #86355

Closed
rocallahan mannequin opened this issue Oct 29, 2020 · 4 comments
Closed

copy.deepcopy() no longer works on platform.uname_result objects #86355

rocallahan mannequin opened this issue Oct 29, 2020 · 4 comments
Assignees
Labels
3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@rocallahan
Copy link
Mannequin

rocallahan mannequin commented Oct 29, 2020

BPO 42189
Nosy @jaraco
PRs
  • bpo-42163, bpo-42189, bpo-42659: Support uname_tuple._replace (for all but processor) #23010
  • [3.9] bpo-42163, bpo-42189, bpo-42659: Support uname_tuple._replace (GH-23010) #24232
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/jaraco'
    closed_at = <Date 2021-01-16.19:46:42.134>
    created_at = <Date 2020-10-29.01:53:35.133>
    labels = ['type-bug', 'library', '3.9', '3.10']
    title = 'copy.deepcopy() no longer works on platform.uname_result objects'
    updated_at = <Date 2021-01-16.19:46:42.133>
    user = 'https://bugs.python.org/rocallahan'

    bugs.python.org fields:

    activity = <Date 2021-01-16.19:46:42.133>
    actor = 'jaraco'
    assignee = 'jaraco'
    closed = True
    closed_date = <Date 2021-01-16.19:46:42.134>
    closer = 'jaraco'
    components = ['Library (Lib)']
    creation = <Date 2020-10-29.01:53:35.133>
    creator = 'rocallahan'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42189
    keywords = ['patch']
    message_count = 4.0
    messages = ['379853', '379870', '384130', '385147']
    nosy_count = 2.0
    nosy_names = ['jaraco', 'rocallahan']
    pr_nums = ['23010', '24232']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue42189'
    versions = ['Python 3.9', 'Python 3.10']

    @rocallahan
    Copy link
    Mannequin Author

    rocallahan mannequin commented Oct 29, 2020

    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 bpo-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

    @rocallahan rocallahan mannequin added 3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Oct 29, 2020
    @jaraco
    Copy link
    Member

    jaraco commented Oct 29, 2020

    Acknowledged. Thanks for the report. I'll likely address this issue alongside the other (same PR).

    @jaraco
    Copy link
    Member

    jaraco commented Dec 31, 2020

    New changeset a6fd0f4 by Jason R. Coombs in branch 'master':
    bpo-42163, bpo-42189, bpo-42659: Support uname_tuple._replace (for all but processor) (bpo-23010)
    a6fd0f4

    @jaraco
    Copy link
    Member

    jaraco commented Jan 16, 2021

    New changeset 799722c 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) (bpo-24232)
    799722c

    @jaraco jaraco closed this as completed Jan 16, 2021
    @jaraco jaraco closed this as completed Jan 16, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant