Skip to content

Requirement pickle drops specifier prereleases #1204

Closed

Description

@notatallshaw
>>> import pickle
>>> from packaging.requirements import Requirement
>>> r = Requirement("foo>=1.0")
>>> r.specifier.prereleases = True
>>> pickle.loads(pickle.dumps(r)).specifier.prereleases is None
True

Expected: loaded.specifier.prereleases == True.

Activity

  1. notatallshaw commented on May 31, 2026

    @notatallshaw
    MemberAuthor

    I don't rely on this or have a use case, it just came up as a correctness issue while I was reviewing my own PR.

  2. added a commit that references this issue on Jun 1, 2026
    5e67ba1
  3. added a commit that references this issue on Jun 1, 2026
    5c163f5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions