Commit Graph

121 Commits

Author SHA1 Message Date
Berker Peksag 3fe64d0c5c Issue #16915: Clarify that mode parameter of socket.makefile() does not accept
the same values as open().
2016-02-18 17:34:00 +02:00
Benjamin Peterson 2775d85d55 merge 3.4 (#25471) 2015-10-24 20:07:08 -07:00
Benjamin Peterson d9dbf49383 accepted sockets shouldn't inherit the SOCK_NONBLOCK flag (closes #25471) 2015-10-24 20:06:04 -07:00
Ethan Furman 24e837f231 issue23673
add private method to enum to support replacing global constants with Enum members:
- search for candidate constants via supplied filter
- create new enum class and members
- insert enum class and replace constants with members via supplied module name
- replace __reduce_ex__ with function that returns member name, so previous Python versions can unpickle
modify IntEnum classes to use new method
2015-03-18 17:27:57 -07:00
Charles-François Natali 6e6c59b508 Issue #23285: PEP 475 -- Retry system calls failing with EINTR. 2015-02-07 13:27:50 +00:00
Benjamin Peterson 610bc6a211 merge 3.4 (#23221) 2015-01-13 09:20:31 -05:00
Benjamin Peterson 82f34ada45 fix instances of consecutive articles (closes #23221)
Patch by Karan Goel.
2015-01-13 09:17:24 -05:00
Serhiy Storchaka a9568bb44a Issue #20604: Added missed invalid mode in error message of socket.makefile().
Based on patch by Franck Michea.
2014-11-19 12:34:07 +02:00
Serhiy Storchaka fca2fc090c Issue #20604: Added missed invalid mode in error message of socket.makefile().
Based on patch by Franck Michea.
2014-11-19 12:33:40 +02:00
Ethan Furman 61358f4622 Issue20689: add missing API pieces to __all__ 2014-10-18 15:11:03 -07:00
Ethan Furman 8e120ac05c Issue20689: add missing API pieces to __all__ 2014-10-18 15:10:49 -07:00
Ethan Furman 41d31967c6 Issue20386: SocketType is again socket.socket; the IntEnum SOCK constants are SocketKind 2014-10-14 18:57:58 -07:00
Ethan Furman 7184bac544 Issue20386: SocketType is again socket.socket; the IntEnum SOCK constants are SocketKind 2014-10-14 18:56:53 -07:00
Charles-François Natali 98c745a773 Issue #18643: Add socket.socketpair() on Windows. 2014-10-14 21:22:44 +01:00
Serhiy Storchaka 521e5860a5 Issue #22032: __qualname__ instead of __name__ is now always used to format
fully qualified class names of Python implemented classes.
2014-07-22 15:00:37 +03:00
Ethan Furman 482fe0477e issue23673
add private method to enum to support replacing global constants with Enum members:
- search for candidate constants via supplied filter
- create new enum class and members
- insert enum class and replace constants with members via supplied module name
- replace __reduce_ex__ with function that returns member name, so previous Python versions can unpickle
modify IntEnum classes to use new method
2015-03-18 18:19:30 -07:00
Giampaolo Rodola' 915d14190e fix issue #17552: add socket.sendfile() method allowing to send a file over a socket by using high-performance os.sendfile() on UNIX. Patch by Giampaolo Rodola'· 2014-06-11 03:54:30 +02:00
Giampaolo Rodola' b62814998a Provide a more readable representation of socket on repr().
Before:
<socket.socket fd=3, family=2, type=1, proto=0, laddr=('0.0.0.0', 0)>

Now:
<socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketType.SOCK_STREAM, proto=0, laddr=('0.0.0.0', 0)>
2013-10-03 21:01:43 +02:00
Eli Bendersky b2ff3cf0e9 Switch the AF_* and SOCK_* constants in the socket module to IntEnum.
Closes #18720.
2013-08-31 15:13:30 -07:00
Victor Stinner daf455554b Issue #18571: Implementation of the PEP 446: file descriptors and file handles
are now created non-inheritable; add functions os.get/set_inheritable(),
os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
2013-08-28 00:53:59 +02:00
Brett Cannon cd171c8e92 Issue #18200: Back out usage of ModuleNotFoundError (8d28d44f3a9a) 2013-07-04 17:43:24 -04:00
Brett Cannon 0a140668fa Issue #18200: Update the stdlib (except tests) to use
ModuleNotFoundError.
2013-06-13 20:57:26 -04:00
Giampaolo Rodola' 50331cbf08 Fix issue #17675: make socket repr() provide local and remote addresses (if any). 2013-04-10 15:49:47 +02:00
Andrew Svetlov f7a17b48d7 Replace IOError with OSError (#16715) 2012-12-25 16:47:37 +02:00
Antoine Pitrou 9b1c84b586 Issue #15842: the SocketIO.{readable,writable,seekable} methods now raise ValueError when the file-like object is closed.
Patch by Alessandro Moura.
2012-09-14 17:30:31 +02:00
Antoine Pitrou 1e7ee9dfa0 Issue #15842: the SocketIO.{readable,writable,seekable} methods now raise ValueError when the file-like object is closed.
Patch by Alessandro Moura.
2012-09-14 17:28:10 +02:00
Kristján Valur Jónsson 10f383a937 Issue #14310: inter-process socket duplication for windows 2012-04-07 11:23:31 +00:00
Antoine Pitrou 8315f96764 Issue #13872: socket.detach() now marks the socket closed (as mirrored in the socket repr()).
Patch by Matt Joiner.
2012-04-01 01:00:55 +02:00
Antoine Pitrou 70deb3de39 Issue #13872: socket.detach() now marks the socket closed (as mirrored in the socket repr()).
Patch by Matt Joiner.
2012-04-01 01:00:17 +02:00
Antoine Pitrou 24d659daaf Use InterruptedError instead of checking for EINTR 2011-10-23 23:49:42 +02:00
Antoine Pitrou 6d58d64919 Issue #11127: Raise a TypeError when trying to pickle a socket object. 2011-03-20 23:56:36 +01:00
Antoine Pitrou 5d5381ed00 Merged revisions 88622 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r88622 | antoine.pitrou | 2011-02-26 00:07:44 +0100 (sam., 26 févr. 2011) | 5 lines

  Issue #7322: Trying to read from a socket's file-like object after a timeout
  occurred now raises an error instead of silently losing data.
  Patch by Ross Lagerwall.
........
2011-02-25 23:14:08 +00:00
Antoine Pitrou 68e5c044e8 Issue #7322: Trying to read from a socket's file-like object after a timeout
occurred now raises an error instead of silently losing data.
Patch by Ross Lagerwall.
2011-02-25 23:07:44 +00:00
Antoine Pitrou 600232b562 Issue #7995: When calling accept() on a socket with a timeout, the returned
socket is now always non-blocking, regardless of the operating system.
2011-01-05 21:03:42 +00:00
Victor Stinner c3a51ecb85 Issue #10819: SocketIO.name property returns -1 when its closed, instead of
raising a ValueError, to fix repr().
2011-01-04 11:00:45 +00:00
Antoine Pitrou e033e06db0 Issue #10093: ResourceWarnings are now issued when files and sockets are
deallocated without explicit closing.  These warnings are silenced by
default, except in pydebug mode.
2010-10-29 10:38:18 +00:00
Antoine Pitrou 834bd81c51 Issue #10041: The signature of optional arguments in socket.makefile()
didn't match that of io.open(), and they also didn't get forwarded
properly to TextIOWrapper in text mode.  Patch by Kai Zhu.
2010-10-13 16:17:14 +00:00
Antoine Pitrou 98b46702d2 Issue #9854: SocketIO objects now observe the RawIOBase interface in
non-blocking mode: they return None when an operation would block (instead
of raising an exception).
2010-09-18 22:59:00 +00:00
Antoine Pitrou 8dd2387a60 Reverted unwanted change in r84826 2010-09-15 11:12:57 +00:00
Antoine Pitrou 5aa0d10560 Improve docs for socket.makefile() and SocketIO 2010-09-15 09:32:45 +00:00
Antoine Pitrou 872b79d02f Add a comment explaining why SocketIO is needed 2010-09-15 08:39:25 +00:00
Antoine Pitrou 9e0b864ac0 Issue #1552: socket.socketpair() now returns regular socket.socket
objects supporting the whole socket API (rather than the "raw"
_socket.socket objects).
2010-09-14 18:00:02 +00:00
Giampaolo Rodolà b383dbb45e Fix issue 9794: adds context manager protocol to socket.socket so that socket.create_connection() can be used with the 'with' statement. 2010-09-08 22:44:12 +00:00
Antoine Pitrou 4b92b5fad3 Issue #9792: In case of connection failure, socket.create_connection()
would swallow the exception and raise a new one, making it impossible
to fetch the original errno, or to filter timeout errors.  Now the
original error is re-raised.
2010-09-07 21:05:49 +00:00
Benjamin Peterson 49203dc9f2 reformat comment 2010-08-31 20:10:55 +00:00
Daniel Stutzbach 19d6a4fd49 Issue #808164: Fixed socket.close to avoid references to globals, to
avoid issues when socket.close is called from a __del__ method.
2010-08-31 20:08:07 +00:00
Benjamin Peterson 34d17debb7 remove SocketIO.__del__; close() can handle it 2010-07-09 18:28:25 +00:00
Gregory P. Smith aafdca895b Merged revisions 74426 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r74426 | gregory.p.smith | 2009-08-13 11:54:50 -0700 (Thu, 13 Aug 2009) | 4 lines

  Fix issue1628205: Socket file objects returned by socket.socket.makefile() now
  properly handles EINTR within the read, readline, write & flush methods.
  The socket.sendall() method now properly handles interrupted system calls.
........
2010-01-04 04:50:36 +00:00
Gregory P. Smith b4066374db Merged revisions 77263-77264 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77263 | gregory.p.smith | 2010-01-02 17:29:44 -0800 (Sat, 02 Jan 2010) | 4 lines

  Adds an optional source_address parameter to socket.create_connection().

  For use by issue3972.
........
  r77264 | gregory.p.smith | 2010-01-02 18:06:07 -0800 (Sat, 02 Jan 2010) | 5 lines

  issue3972: HTTPConnection and HTTPSConnection now support a
  source_address parameter.

  Also cleans up an annotation in the socket documentation.
........
2010-01-03 03:28:29 +00:00
Mark Dickinson 5c91bf3e93 Merged revisions 73138 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73138 | mark.dickinson | 2009-06-02 08:39:26 +0100 (Tue, 02 Jun 2009) | 1 line

  Typo in socket.py.  Thanks Pablo Torres Navarrete.
........
2009-06-02 07:41:26 +00:00