| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
exposed on the API which are not implemented on GNU/Hurd. They would not
work at runtime anyway.
|
| |
|
|
| |
api-level >= 23. Patch by Xavier de Gaye.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
On Windows, socket.setsockopt() raises an OverflowError if the socket option is
larger than INT_MAX bytes.
|
| |
|
|
|
|
|
| |
Issue #26590: Implement a safe finalizer for the _socket.socket type. It now
releases the GIL to close the socket. Use PyErr_ResourceWarning() to raise the
ResourceWarning to pass the socket object to the warning logger, to get the
traceback where the socket was created (allocated).
|
| |
|
|
| |
io.FileIO has a safe implementation of destructor, but not socket nor scandir.
|
| |
|
|
|
|
|
|
|
|
| |
Issue #26567:
* Add a new function PyErr_ResourceWarning() function to pass the destroyed
object
* Add a source attribute to warnings.WarningMessage
* Add warnings._showwarnmsg() which uses tracemalloc to get the traceback where
source object was allocated.
|
| |\ |
|
| | |
| |
| |
| | |
current versions of OpenBSD and NetBSD. Patch by A. Jesse Jiryu Davis.
|
| |\ \
| |/ |
|
| | |
| |
| |
| | |
versions 10.5 or higher. Original patch by A. Jesse Jiryu Davis.
|
| |\ \
| |/ |
|
| | |
| |
| |
| |
| |
| | |
Issue #26227: On Windows, getnameinfo(), gethostbyaddr() and gethostbyname_ex()
functions of the socket module now decode the hostname from the ANSI code page
rather than UTF-8.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Add "#ifdef WITH_THREAD" around cals to:
* PyGILState_Check()
* _PyImport_AcquireLock()
* _PyImport_ReleaseLock()
|
| | | |
|
| | |
| |
| |
| | |
private functions.
|
| |/
|
|
|
|
|
|
| |
Add "#ifdef WITH_THREAD" around cals to:
* PyGILState_Check()
* _PyImport_AcquireLock()
* _PyImport_ReleaseLock()
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| | |
PyUnicode_AsEncodedString() instead of calling the encode() method of the
host, to handle correctly custom string with an encode() method which doesn't
return a byte string. The encoder of the IDNA codec is now called directly
instead of calling the encode() method of the string.
|
| | |
| |
| |
| | |
result of sendto() instead of the C int type.
|
| | |
| |
| |
| | |
accept() returns INVALID_SOCKET on error, it's not necessary a negative number.
|
| | |
| |
| |
| | |
Patch courtesy of Joe Jevnik.
|
| | |
| |
| |
| |
| |
| |
| | |
poll() is not available.
select() doesn't accept negative timeout, the timeout parameter must be NULL to
block on select().
|
| | |
| |
| |
| | |
Use -1 second by default, not -1 nanosecond.
|
| | |
| |
| |
| |
| | |
Call internal_select() with a timeout of 0 second, not a timeout of -1 second
(blocking)!
|
| | |
| |
| |
| |
| | |
each time data is sent successfuly. The socket timeout is now the maximum total
duration to send all data.
|
| | |
| |
| |
| |
| |
| | |
Use _PyTime_FromSeconds() to initialize the default socket timeout to -1
second, instead of -1 nanosecond which causes rounding issues in
internal_select().
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Use the new _PyTime_FromSeconds() function to set the timeout to -1 second
for socket.settimeout(None). It avoids a special case in internal_select()
because of a rounding issue: -1 nanosecond is rounded to 0 millisecond which
means non-blocking, instead of blocking.
* Check if the interval the negative in sock_call_ex() instead of doing the
check in internal_select(). sock_call_ex() remembers if the socket has a
timeout or not, which avoids a race condition if the timeout is modified in a
different thread.
|
| | | |
|
| | |
| |
| |
| |
| | |
sock_call_ex() gets the socket error code when the socket function fails.
sock_connect_impl() didn't set the error correctly.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
instead of raising InterruptedError if the connection is interrupted by
signals, signal handlers don't raise an exception and the socket is blocking or
has a timeout.
socket.socket.connect() still raise InterruptedError for non-blocking sockets.
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
sock_send_impl()
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The BEGIN_SELECT_LOOP and END_SELECT_LOOP macros of socketmodule.c don't handle
EINTR. Functions using these macros use an inner loop to handle EINTR, but they
don't recompute the timeout.
This changes replaces the two macros with a new sock_call() function which
takes a function as a parameter. sock_call() recomputes the timeout, handle
false positive and handle EINTR.
|
| |\ \
| |/ |
|
| | | |
|
| | |
| |
| |
| | |
Windows uses WSAEINTR error code, not EINTR, for socket functions.
|
| | |
| |
| |
| |
| |
| |
| | |
Call PyErr_CheckSignals() immediatly if connect() or select() fails with EINTR
in internal_connect().
Refactor also the code to limit indentaton and make it more readable.
|
| | |
| |
| |
| |
| | |
Call PyErr_CheckSignals() if connect(), select() or getsockopt() failed with
EINTR.
|
| | |
| |
| |
| |
| | |
On Windows, it looks like using the C type socklen_t for getsockopt() (instead
of int) is fine, it was already used in socket.getsockopt().
|
| | |
| |
| |
| |
| | |
On Windows, internal_connect() now reuses internal_connect_select() and always
calls getsockopt().
|
| | |
| |
| |
| |
| |
| |
| | |
The function now returns the error code instead of using the global errno
(POSIX) or WSAGetLastError() (Windows).
internal_connect() now returns errno if getsockopt() fails.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
* Inline internal_select() function
* Rename internal_select_ex() internal_select()
|