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: sockets should not be pickleable
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: giampaolo.rodola, pitrou, python-dev, xuanji
Priority: normal Keywords: patch

Created on 2011-02-05 08:30 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue11127.patch xuanji, 2011-02-20 11:32 review
Messages (5)
msg127976 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-02-05 08:30
Like already done for file objects, sockets should refuse pickling by raising a TypeError.
msg128901 - (view) Author: Xuanji Li (xuanji) * Date: 2011-02-20 11:32
the correct way is to provide a __getstate__ method for socket right? I have implemented that in the attached patch.
msg128915 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-02-20 16:44
You also need to a test to Lib/test/test_socket.py.
msg131562 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-03-20 22:58
New changeset 5e13e5e6df30 by Antoine Pitrou in branch 'default':
Issue #11127: Raise a TypeError when trying to pickle a socket object.
http://hg.python.org/cpython/rev/5e13e5e6df30
msg131563 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-03-20 22:59
Committed the patch with the test, thank you!
History
Date User Action Args
2022-04-11 14:57:12adminsetgithub: 55336
2011-03-20 22:59:12pitrousetstatus: open -> closed
nosy: pitrou, giampaolo.rodola, xuanji, python-dev
messages: + msg131563

resolution: fixed
stage: needs patch -> resolved
2011-03-20 22:58:46python-devsetnosy: + python-dev
messages: + msg131562
2011-02-20 16:44:59pitrousetnosy: pitrou, giampaolo.rodola, xuanji
messages: + msg128915
2011-02-20 11:32:23xuanjisetfiles: + issue11127.patch

nosy: + xuanji
messages: + msg128901

keywords: + patch
2011-02-05 18:51:15giampaolo.rodolasetnosy: + giampaolo.rodola
2011-02-05 08:30:26pitroucreate