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

uuid.UUID objects can't be unpickled in older Python versions (<3.7) #78802

Closed
taleinat opened this issue Sep 10, 2018 · 4 comments
Closed

uuid.UUID objects can't be unpickled in older Python versions (<3.7) #78802

taleinat opened this issue Sep 10, 2018 · 4 comments
Labels
3.7 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@taleinat
Copy link
Contributor

BPO 34621
Nosy @taleinat, @serhiy-storchaka
PRs
  • [3.7] bpo-34621: fix uuid.UUID (un)pickling compatbility with older Python versions (<3.7) #9133
  • [3.7] bpo-34621: backwards-compatible pickle UUID with is_safe=unknown #14834
  • 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 = None
    closed_at = <Date 2018-09-10.15:47:50.435>
    created_at = <Date 2018-09-10.12:16:57.781>
    labels = ['3.7', 'type-bug', 'library']
    title = "uuid.UUID objects can't be unpickled in older Python versions (<3.7)"
    updated_at = <Date 2019-08-04.19:30:11.204>
    user = 'https://github.com/taleinat'

    bugs.python.org fields:

    activity = <Date 2019-08-04.19:30:11.204>
    actor = 'taleinat'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-09-10.15:47:50.435>
    closer = 'taleinat'
    components = ['Library (Lib)']
    creation = <Date 2018-09-10.12:16:57.781>
    creator = 'taleinat'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34621
    keywords = ['patch']
    message_count = 4.0
    messages = ['324919', '324927', '348997', '348999']
    nosy_count = 2.0
    nosy_names = ['taleinat', 'serhiy.storchaka']
    pr_nums = ['9133', '14834']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue34621'
    versions = ['Python 3.7']

    @taleinat
    Copy link
    Contributor Author

    This affects only 3.7, where the new SafeUUID enum was introduced.

    This was fixed on the master branch (3.8) while implementing bpo-30977.

    Fixing this should simply require defining similar __getstate__ and __setstate__ methods as in 3.8.

    @taleinat taleinat added 3.7 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Sep 10, 2018
    @taleinat
    Copy link
    Contributor Author

    New changeset d53f1ca by Tal Einat in branch '3.7':
    [3.7] bpo-34621: fix uuid.UUID (un)pickling compatbility with older Python versions (<3.7) (GH-9133)
    d53f1ca

    @taleinat
    Copy link
    Contributor Author

    taleinat commented Aug 4, 2019

    New changeset a2ea944 by Tal Einat in branch '3.7':
    [3.7] bpo-34621: backwards-compatible pickle UUID with is_safe=unknown (GH-14834)
    a2ea944

    @taleinat
    Copy link
    Contributor Author

    taleinat commented Aug 4, 2019

    Note that the original fix, in PR #53379, contained a bug: UUID objects with is_safe set to SafeUUID.unknown would cause an exception if unpickled with Python <3.7.

    This was reported by Thomas Wiebe in a comment to a commit in that PR:
    d53f1ca#commitcomment-31396021

    This is now fixed, see PR #59039.

    @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.7 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