cpython/Lib
Jeremy Hylton 5accbdb812 Make sure socket.close() doesn't interfere with socket.makefile().
If a makefile()-generated object is open and its parent socket is
closed, the parent socket should remain open until the child is
closed, too.  The code to support this is moderately complex and
requires one extra slots in the socket object.

This change fixes httplib so that several urllib2net test cases pass
again.

Add SocketCloser class to socket.py, which encapsulates the
refcounting logic for sockets after makefile() has been called.

Move SocketIO class from io module to socket module.  It's only use is
to implement the raw I/O methods on top of a socket to support
makefile().

Add unittests to test_socket to cover various patterns of close and
makefile.
2007-08-03 20:40:09 +00:00
..
bsddb Getting rid of cPickle. Mmm, feels good! 2007-07-20 00:22:32 +00:00
ctypes Merged revisions 56301-56442 via svnmerge from 2007-07-18 18:15:48 +00:00
curses Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
distutils Fix two bugs from the map->itertools.imap switch. 2007-07-17 00:39:32 +00:00
email SF patch# 1757839 by Alexandre Vassalotti -- make test_mailbox and 2007-07-21 00:21:26 +00:00
encodings Change a bunch of file encodings from Latin-1 to UTF-8. 2007-07-16 23:10:57 +00:00
hotshot PEP 3114: rename .next() to .__next__() and add next() builtin. 2007-04-21 15:47:16 +00:00
idlelib Merged revisions 56483-56491 via svnmerge from 2007-07-22 14:41:55 +00:00
lib-tk Merged revisions 56301-56442 via svnmerge from 2007-07-18 18:15:48 +00:00
logging Getting rid of cPickle. Mmm, feels good! 2007-07-20 00:22:32 +00:00
msilib Change a bunch of file encodings from Latin-1 to UTF-8. 2007-07-16 23:10:57 +00:00
plat-aix4 Rip out 'long' and 'L'-suffixed integer literals. 2007-01-15 16:59:06 +00:00
plat-atheos Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
plat-beos5 Rip out 'long' and 'L'-suffixed integer literals. 2007-01-15 16:59:06 +00:00
plat-darwin
plat-freebsd4
plat-freebsd5
plat-freebsd6
plat-freebsd7 Whitespace normalization. 2005-07-17 23:16:17 +00:00
plat-generic
plat-linux2 Rip out 'long' and 'L'-suffixed integer literals. 2007-01-15 16:59:06 +00:00
plat-mac SF patch# 1761465 by Jeffrey Yasskin. 2007-07-27 04:41:00 +00:00
plat-netbsd1
plat-next3
plat-os2emx Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
plat-riscos Merged revisions 55007-55179 via svnmerge from 2007-05-07 22:24:25 +00:00
plat-sunos5 Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
plat-unixware7 Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
site-packages
sqlite3 Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
test Make sure socket.close() doesn't interfere with socket.makefile(). 2007-08-03 20:40:09 +00:00
wsgiref Merged revisions 55795-55816 via svnmerge from 2007-06-07 23:15:56 +00:00
xml Patch #1762412: Fix test case for struni branch. 2007-07-28 11:40:46 +00:00
BaseHTTPServer.py Treat HTTP status line as ISO-8859-1 as in httplib module. 2007-08-03 20:32:27 +00:00
CGIHTTPServer.py Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
ConfigParser.py Merged revisions 55325-55327 via svnmerge from 2007-05-14 22:51:27 +00:00
Cookie.py Fix test_cookie.py. 2007-07-20 00:30:38 +00:00
DocXMLRPCServer.py Merged revisions 53952-54987 via svnmerge from 2007-04-27 19:54:29 +00:00
HTMLParser.py Rename 'unicode' to 'str' in its tp_name field. Rename 'str' to 'str8'. 2007-05-03 17:18:26 +00:00
Queue.py Four months of trunk changes (including a few releases...) 2006-12-13 04:49:30 +00:00
SimpleHTTPServer.py Change some uses of cStringIO.StringIO to io.StringIO. 2007-05-18 00:51:22 +00:00
SimpleXMLRPCServer.py Merged revisions 55407-55513 via svnmerge from 2007-05-22 18:11:13 +00:00
SocketServer.py SF patch# 1764815 by Paul Colomiets. 2007-08-03 19:03:39 +00:00
StringIO.py PEP 3114: rename .next() to .__next__() and add next() builtin. 2007-04-21 15:47:16 +00:00
UserDict.py PEP 3114: rename .next() to .__next__() and add next() builtin. 2007-04-21 15:47:16 +00:00
UserList.py
UserString.py Rip out 'long' and 'L'-suffixed integer literals. 2007-01-15 16:59:06 +00:00
_LWPCookieJar.py - PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone; 2007-02-11 06:12:03 +00:00
_MozillaCookieJar.py Merged revisions 46753-51188 via svnmerge from 2006-08-11 14:57:12 +00:00
__future__.py Merge p3yk branch with the trunk up to revision 45595. This breaks a fair 2006-04-21 10:40:58 +00:00
__phello__.foo.py
_abcoll.py Merged revisions 55962-56019 via svnmerge from 2007-06-18 17:58:50 +00:00
_strptime.py Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
_threading_local.py - PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone; 2007-02-11 06:12:03 +00:00
abc.py Tests for @abstractproperty by Jeffrey Yasskin. 2007-08-01 17:52:23 +00:00
aifc.py Merged revisions 55328-55341 via svnmerge from 2007-05-15 18:46:22 +00:00
anydbm.py Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
asynchat.py Fix asynchat to use bytes instead of strings. 2007-07-12 07:58:54 +00:00
asyncore.py Fix test_asyncore after merge. It needs to use bytes. 2007-07-18 20:57:44 +00:00
audiodev.py Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
base64.py Make test_base64 pass. 2007-05-22 21:56:47 +00:00
bdb.py Merged revisions 55328-55341 via svnmerge from 2007-05-15 18:46:22 +00:00
binhex.py Make the binhex test pass on Darwin. 2007-05-27 09:20:49 +00:00
bisect.py Merged revisions 53952-54987 via svnmerge from 2007-04-27 19:54:29 +00:00
build_class.py Implement PEP 3115 -- new metaclass syntax and semantics. 2007-03-18 15:41:51 +00:00
cProfile.py Fix for cProfile. 2007-07-16 23:36:05 +00:00
calendar.py Merged revisions 55007-55179 via svnmerge from 2007-05-07 22:24:25 +00:00
cgi.py Merged revisions 56125-56153 via svnmerge from 2007-07-03 08:25:58 +00:00
cgitb.py Merged revisions 55795-55816 via svnmerge from 2007-06-07 23:15:56 +00:00
chunk.py Make a few more tests pass with the new I/O library. 2007-04-12 22:55:07 +00:00
cmd.py Fix pdb help command. 2007-06-07 22:37:45 +00:00
code.py Kill off softspace completely (except in formatter.py which seems to have 2007-02-09 23:20:19 +00:00
codecs.py Make the BOM constants in codecs.py bytes. 2007-05-04 13:05:09 +00:00
codeop.py SF patch 1631942 by Collin Winter: 2007-01-10 16:19:56 +00:00
collections.py Getting rid of cPickle. Mmm, feels good! 2007-07-20 00:22:32 +00:00
colorsys.py Four months of trunk changes (including a few releases...) 2006-12-13 04:49:30 +00:00
commands.py Merged revisions 55225-55227,55229-55269 via svnmerge from 2007-05-11 16:50:42 +00:00
compileall.py Improve error handling; don't die from unicode errors or syntax errors. 2007-07-15 13:01:48 +00:00
contextlib.py PEP 3114: rename .next() to .__next__() and add next() builtin. 2007-04-21 15:47:16 +00:00
cookielib.py SF patch# 1762940 by Joe Gregorio. 2007-08-03 19:19:24 +00:00
copy.py Merged revisions 55795-55816 via svnmerge from 2007-06-07 23:15:56 +00:00
copy_reg.py Getting rid of cPickle. Mmm, feels good! 2007-07-20 00:22:32 +00:00
csv.py Merged revisions 56125-56153 via svnmerge from 2007-07-03 08:25:58 +00:00
dbhash.py Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
decimal.py Merged revisions 56125-56153 via svnmerge from 2007-07-03 08:25:58 +00:00
difflib.py Merged revisions 56125-56153 via svnmerge from 2007-07-03 08:25:58 +00:00
dircache.py
dis.py Merged revisions 55795-55816 via svnmerge from 2007-06-07 23:15:56 +00:00
doctest.py SF patch# 1766592 by Paul Colomiets. 2007-08-03 18:40:49 +00:00
dumbdbm.py Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
dummy_thread.py Merged revisions 53538-53622 via svnmerge from 2007-02-05 01:24:16 +00:00
dummy_threading.py Merged revisions 53538-53622 via svnmerge from 2007-02-05 01:24:16 +00:00
filecmp.py Merged revisions 56125-56153 via svnmerge from 2007-07-03 08:25:58 +00:00
fileinput.py Merged revisions 55407-55513 via svnmerge from 2007-05-22 18:11:13 +00:00
fnmatch.py
formatter.py Merged revisions 55328-55341 via svnmerge from 2007-05-15 18:46:22 +00:00
fpformat.py Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
ftplib.py Minimal changes to make ftplib work. Basically, this opens the stream in 2007-07-17 20:45:57 +00:00
functools.py Four months of trunk changes (including a few releases...) 2006-12-13 04:49:30 +00:00
genericpath.py Merged revisions 55325-55327 via svnmerge from 2007-05-14 22:51:27 +00:00
getopt.py Change a bunch of file encodings from Latin-1 to UTF-8. 2007-07-16 23:10:57 +00:00
getpass.py Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
gettext.py Fixes for str/uni/bytes for gettext.py. test_gettext.py passes. 2007-07-12 08:04:06 +00:00
glob.py Rip out all the u"..." literals and calls to unicode(). 2007-05-02 19:09:54 +00:00
gzip.py Fix gzip.py: Use bytes where 8bit strings have been used formerly. 2007-06-06 16:43:59 +00:00
hashlib.py Four months of trunk changes (including a few releases...) 2006-12-13 04:49:30 +00:00
heapq.py Merged revisions 56125-56153 via svnmerge from 2007-07-03 08:25:58 +00:00
hmac.py Make hmac use bytes. Make test_hmac pass. 2007-07-10 13:35:52 +00:00
htmlentitydefs.py - PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone; 2007-02-11 06:12:03 +00:00
htmllib.py Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
httplib.py A few local changes for consistency of string literals. 2007-08-03 20:30:33 +00:00
ihooks.py Merged revisions 55631-55794 via svnmerge from 2007-06-06 23:52:48 +00:00
imaplib.py Merged revisions 53952-54987 via svnmerge from 2007-04-27 19:54:29 +00:00
imghdr.py Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
imputil.py Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
inspect.py Merged revisions 56301-56442 via svnmerge from 2007-07-18 18:15:48 +00:00
io.py Make sure socket.close() doesn't interfere with socket.makefile(). 2007-08-03 20:40:09 +00:00
keyword.py Merged revisions 56020-56124 via svnmerge from 2007-06-30 05:01:58 +00:00
linecache.py Be even more lenient when catching errors from readlines(). 2007-07-10 11:34:31 +00:00
locale.py Merged revisions 55325-55327 via svnmerge from 2007-05-14 22:51:27 +00:00
macpath.py Merged revisions 53952-54987 via svnmerge from 2007-04-27 19:54:29 +00:00
macurl2path.py Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
mailbox.py SF patch# 1757839 by Alexandre Vassalotti -- make test_mailbox and 2007-07-21 00:21:26 +00:00
mailcap.py - PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone; 2007-02-11 06:12:03 +00:00
markupbase.py Merge the rest of the trunk. 2006-06-08 15:35:45 +00:00
mhlib.py Merged revisions 56125-56153 via svnmerge from 2007-07-03 08:25:58 +00:00
mimetools.py Merge p3yk branch with the trunk up to revision 45595. This breaks a fair 2006-04-21 10:40:58 +00:00
mimetypes.py Merged revisions 55325-55327 via svnmerge from 2007-05-14 22:51:27 +00:00
modulefinder.py Some quick fixes of code that was sorting dict.keys() etc. 2007-06-12 00:25:08 +00:00
multifile.py
mutex.py
netrc.py Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
new.py Merged revisions 55795-55816 via svnmerge from 2007-06-07 23:15:56 +00:00
nntplib.py Fix a bunch of doctests with the -d option of refactor.py. 2007-02-09 20:13:25 +00:00
ntpath.py Merged revisions 53952-54987 via svnmerge from 2007-04-27 19:54:29 +00:00
nturl2path.py Bug #649974: make docstrings for url2pathname consistent 2005-12-26 22:53:56 +00:00
opcode.py Hide list comp variables and support set comprehensions 2007-04-15 12:05:43 +00:00
optparse.py Merged revisions 56125-56153 via svnmerge from 2007-07-03 08:25:58 +00:00
os.py Reduce redundant calls to str() in _Environ class. 2007-06-13 21:52:41 +00:00
os2emxpath.py Four months of trunk changes (including a few releases...) 2006-12-13 04:49:30 +00:00
pdb.doc Merged revisions 53952-54987 via svnmerge from 2007-04-27 19:54:29 +00:00
pdb.py Use input(), not our own fake raw input (in one place). 2007-05-27 09:19:52 +00:00
pickle.py Getting rid of cPickle. Mmm, feels good! 2007-07-20 00:22:32 +00:00
pickletools.py Getting rid of cPickle. Mmm, feels good! 2007-07-20 00:22:32 +00:00
pipes.py Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
pkgutil.py SF patch 1631942 by Collin Winter: 2007-01-10 16:19:56 +00:00
platform.py Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
poplib.py Fix test_poplib failures. 2007-07-23 00:24:10 +00:00
posixpath.py Merged revisions 53952-54987 via svnmerge from 2007-04-27 19:54:29 +00:00
pprint.py Merged revisions 55328-55341 via svnmerge from 2007-05-15 18:46:22 +00:00
profile.py - PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone; 2007-02-11 06:12:03 +00:00
pstats.py PEP 3114: rename .next() to .__next__() and add next() builtin. 2007-04-21 15:47:16 +00:00
pty.py Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
py_compile.py Use the encoding specification when reading the source file. 2007-07-15 14:02:52 +00:00
pyclbr.py PEP 3114: rename .next() to .__next__() and add next() builtin. 2007-04-21 15:47:16 +00:00
pydoc.py Fix a bug from the map->itertools.imap conversion. 2007-07-17 00:27:30 +00:00
quopri.py Fix quopri to operate consistently on bytes. 2007-07-28 17:52:25 +00:00
random.py Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
re.py Merged revisions 55407-55513 via svnmerge from 2007-05-22 18:11:13 +00:00
repr.py Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
rfc822.py - PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone; 2007-02-11 06:12:03 +00:00
rlcompleter.py Much-needed merge (using svnmerge.py this time) of trunk changes into p3yk. 2006-05-27 19:21:47 +00:00
robotparser.py Merged revisions 53952-54987 via svnmerge from 2007-04-27 19:54:29 +00:00
runpy.py Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
sched.py Merged revisions 53952-54987 via svnmerge from 2007-04-27 19:54:29 +00:00
sgmllib.py Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
shelve.py Move shelve over to BytesIO as pickle.(Pickler | Unpickler) expect binary 2007-07-26 03:07:02 +00:00
shlex.py Merged revisions 55631-55794 via svnmerge from 2007-06-06 23:52:48 +00:00
shutil.py Merged revisions 53623-53858 via svnmerge from 2007-02-23 15:07:44 +00:00
site.py Add an encoding property to TextIOBase instances. 2007-05-24 17:58:06 +00:00
smtpd.py Change some uses of cStringIO.StringIO to io.StringIO. 2007-05-18 00:51:22 +00:00
smtplib.py Fix a buch of shallow test failures. 2007-06-18 18:26:36 +00:00
sndhdr.py Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
socket.py Make sure socket.close() doesn't interfere with socket.makefile(). 2007-08-03 20:40:09 +00:00
sre.py Merged revisions 53952-54987 via svnmerge from 2007-04-27 19:54:29 +00:00
sre_compile.py Merged revisions 56154-56264 via svnmerge from 2007-07-11 13:09:30 +00:00
sre_constants.py Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
sre_parse.py Merged revisions 55795-55816 via svnmerge from 2007-06-07 23:15:56 +00:00
stat.py Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
statvfs.py
string.py Merged revisions 56125-56153 via svnmerge from 2007-07-03 08:25:58 +00:00
stringprep.py Merged revisions 55007-55179 via svnmerge from 2007-05-07 22:24:25 +00:00
struct.py Make struct tests pass. 2007-05-27 09:19:04 +00:00
subprocess.py The bufsize argument to Popen() should accept None meaning the default (0). 2007-06-07 21:56:45 +00:00
sunau.py Merged revisions 55328-55341 via svnmerge from 2007-05-15 18:46:22 +00:00
sunaudio.py Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
symbol.py Merged revisions 55407-55513 via svnmerge from 2007-05-22 18:11:13 +00:00
symtable.py - PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone; 2007-02-11 06:12:03 +00:00
tabnanny.py Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
tarfile.py Merged revisions 56020-56124 via svnmerge from 2007-06-30 05:01:58 +00:00
telnetlib.py Merged revisions 53952-54987 via svnmerge from 2007-04-27 19:54:29 +00:00
tempfile.py Make test_tempfile.py work. Make SpooledTempFile work in text and binary mode. 2007-07-09 10:24:45 +00:00
textwrap.py Merged revisions 56125-56153 via svnmerge from 2007-07-03 08:25:58 +00:00
this.py Fix most trivially-findable print statements. 2007-02-09 05:37:30 +00:00
threading.py Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
timeit.py Merged revisions 55407-55513 via svnmerge from 2007-05-22 18:11:13 +00:00
toaiff.py SF patch 1631942 by Collin Winter: 2007-01-10 16:19:56 +00:00
token.py Make ELLIPSIS a separate token. This makes it a syntax error to write ". . ." for Ellipsis. 2007-03-18 19:01:53 +00:00
tokenize.py Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
trace.py Getting rid of cPickle. Mmm, feels good! 2007-07-20 00:22:32 +00:00
traceback.py Remove the ability to slice/index on exceptions per PEP 352. 2007-02-27 00:15:55 +00:00
tty.py
types.py Merged revisions 55795-55816 via svnmerge from 2007-06-07 23:15:56 +00:00
unittest.py Add the function/method name to assertRaises. 2007-07-10 09:10:40 +00:00
urllib.py SF patch# 1762940 by Joe Gregorio. 2007-08-03 19:19:24 +00:00
urllib2.py SF patch# 1762940 by Joe Gregorio. 2007-08-03 19:19:24 +00:00
urlparse.py Change some uses of cStringIO.StringIO to io.StringIO. 2007-05-18 00:51:22 +00:00
user.py
uu.py Fix test_uu.py by inserting an explicit conversion from bytes to str 2007-07-16 19:50:03 +00:00
uuid.py Fix test_uuid.py. 2007-07-20 17:45:09 +00:00
warnings.py Merged revisions 55795-55816 via svnmerge from 2007-06-07 23:15:56 +00:00
wave.py Make test_wave.py pass. 2007-07-23 21:28:30 +00:00
weakref.py Merged revisions 55817-55961 via svnmerge from 2007-06-13 18:07:49 +00:00
webbrowser.py Merged revisions 56154-56264 via svnmerge from 2007-07-11 13:09:30 +00:00
whichdb.py Make gdbm and dumbdbm use byte strings. Updated their tests. 2007-05-23 20:51:02 +00:00
wsgiref.egg-info Merged revisions 46753-51188 via svnmerge from 2006-08-11 14:57:12 +00:00
xdrlib.py Move xdrlib over to the bytes type. 2007-07-26 03:19:46 +00:00
xmlrpclib.py In cases where dealing with base64, do the conversion but then get the ASCII 2007-07-30 03:50:35 +00:00
zipfile.py Fix test_zipfile.py. (Why was it passing before?) 2007-07-18 22:07:29 +00:00