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

sockets should not be pickleable #55336

Closed
pitrou opened this issue Feb 5, 2011 · 5 comments
Closed

sockets should not be pickleable #55336

pitrou opened this issue Feb 5, 2011 · 5 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@pitrou
Copy link
Member

pitrou commented Feb 5, 2011

BPO 11127
Nosy @pitrou, @giampaolo, @IIIIllllIIIIllllIIIIllllIIIIllllIIIIll
Files
  • issue11127.patch
  • 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 2011-03-20.22:59:12.686>
    created_at = <Date 2011-02-05.08:30:26.032>
    labels = ['type-bug', 'library']
    title = 'sockets should not be pickleable'
    updated_at = <Date 2011-03-20.22:59:12.684>
    user = 'https://github.com/pitrou'

    bugs.python.org fields:

    activity = <Date 2011-03-20.22:59:12.684>
    actor = 'pitrou'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-03-20.22:59:12.686>
    closer = 'pitrou'
    components = ['Library (Lib)']
    creation = <Date 2011-02-05.08:30:26.032>
    creator = 'pitrou'
    dependencies = []
    files = ['20803']
    hgrepos = []
    issue_num = 11127
    keywords = ['patch']
    message_count = 5.0
    messages = ['127976', '128901', '128915', '131562', '131563']
    nosy_count = 4.0
    nosy_names = ['pitrou', 'giampaolo.rodola', 'xuanji', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue11127'
    versions = ['Python 3.3']

    @pitrou
    Copy link
    Member Author

    pitrou commented Feb 5, 2011

    Like already done for file objects, sockets should refuse pickling by raising a TypeError.

    @pitrou pitrou added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Feb 5, 2011
    @IIIIllllIIIIllllIIIIllllIIIIllllIIIIll
    Copy link
    Mannequin

    the correct way is to provide a __getstate__ method for socket right? I have implemented that in the attached patch.

    @pitrou
    Copy link
    Member Author

    pitrou commented Feb 20, 2011

    You also need to a test to Lib/test/test_socket.py.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 20, 2011

    New changeset 5e13e5e6df30 by Antoine Pitrou in branch 'default':
    Issue bpo-11127: Raise a TypeError when trying to pickle a socket object.
    http://hg.python.org/cpython/rev/5e13e5e6df30

    @pitrou
    Copy link
    Member Author

    pitrou commented Mar 20, 2011

    Committed the patch with the test, thank you!

    @pitrou pitrou closed this as completed Mar 20, 2011
    @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
    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