| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
ntohl(), htonl(), if_indextoname(), getaddrinfo() now use __index__() if
available.
Also fix the Argument Clinic names for module-level functions (although
this does not affect the user).
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
| |
|
|
|
|
| |
Previously only an integer packed in a tuple was accepted, while
getsockname() could return a raw integer.
Now the result of getsockname() is always acceptable as an address.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Now all protocols always accept the Bluetooth address as string and
getsockname() always returns the Bluetooth address as string.
* BTPROTO_SCO now accepts not only bytes, but str.
* BTPROTO_SCO now checks address for embedded null.
* On *BSD, BTPROTO_HCI now accepts str instead of bytes.
* On FreeBSD, getsockname() for BTPROTO_HCI now returns str instead of bytes.
* On NetBSD and DragonFly BDS, BTPROTO_HCI now checks address for embedded null.
|
| |
|
|
|
|
|
| |
(GH-132431)
* Also add support for cid and bdaddr_type in the BTPROTO_L2CAP address on FreeBSD.
* Return cid in getsockname() for BTPROTO_L2CAP if it is not zero.
* Fix a compiler warning on FreeBSD.
|
| |
|
|
| |
BTPROTO_SCO has been supported on FreeBSD since 2008.
|
| |
|
|
|
| |
members (GH-132076)
Now all structure members are initialized with zeroes by default.
|
| |
|
|
|
|
|
|
| |
Don't pass direct references to sockaddr members since their type may
not match PyArg_ParseTuple() types. Instead, use temporary 'int' and
'unsigned char' variables, and update sockaddr members afterwards.
On FreeBSD, treat BTPROTO_HCI node name as a bytes string,
not as an integer.
|
| |
|
|
| |
Add unicode_fsdecode() wrapper for PyUnicode_DecodeFSDefault() to use
the correct API for Py_BuildValue() converter API.
|
| | |
|
| |
|
|
| |
(#131026)
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
address tuple (#129293)
Add two optional, traling elements in the AF_BLUETOOTH socket address tuple:
- l2_cid, to allow e.g raw LE ATT connections
- l2_bdaddr_type. To be able to connect L2CAP sockets to Bluetooth LE devices,
the l2_bdaddr_type must be set to BDADDR_LE_PUBLIC or BDADDR_LE_RANDOM.
|
| |
|
| |
Replace PyErr_WriteUnraisable() with PyErr_FormatUnraisable().
|
| | |
|
| | |
|
| |
|
|
|
| |
state (#128361)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
|
| |
|
| |
Remove unnecessary critical section from `socket.close` as it now uses relaxed atomics for `sock_fd`.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Remove seriously outdated netlink constants.
Co-authored-by: Gregory P. Smith <greg@krypto.org>
|
| |
|
|
|
|
| |
If the timeout is larger than INT_MAX, replace it with INT_MAX, in
the poll() code path.
Add an unit test.
|
| | |
|
| | |
|
| |
|
|
|
| |
Replace PyUnicode_New(0, 0), PyUnicode_FromString("")
and PyUnicode_FromStringAndSize("", 0)
with Py_GetConstant(Py_CONSTANT_EMPTY_STR).
|
| |
|
|
|
| |
POSIX allows errno to be negative.
Even though all currently supported platforms have non-negative errno,
relying on a quirk like that would make Python less portable.
|
| |
|
|
|
| |
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
|
| |
|
|
| |
(GH-120490)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Fix warnings when using -Wimplicit-fallthrough compiler flag.
Annotate explicitly "fall through" switch cases with a new
_Py_FALLTHROUGH macro which uses __attribute__((fallthrough)) if
available. Replace "fall through" comments with _Py_FALLTHROUGH.
Add _Py__has_attribute() macro. No longer define __has_attribute()
macro if it's not defined. Move also _Py__has_builtin() at the top
of pyport.h.
Co-Authored-By: Nikita Sobolev <mail@sobolevn.me>
|
| |
|
|
|
|
|
|
|
|
|
| |
module (#120058)
* gh-120056: Add `IP_RECVERR` and `IP_RECVTTL` to `socket` module
* Fix news
* Address review
* Update NEWS
|
| |
|
|
|
|
|
|
|
|
| |
Add socket.VMADDR_CID_LOCAL constant.
Fix ThreadedVSOCKSocketStreamTest: if get_cid() returns the host
address or the "any" address, use the local communication address
(loopback): VMADDR_CID_LOCAL.
On Linux 6.9, apparently, the /dev/vsock device is now available but
get_cid() returns VMADDR_CID_ANY (-1).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This PR adds the ability to enable the GIL if it was disabled at
interpreter startup, and modifies the multi-phase module initialization
path to enable the GIL when loading a module, unless that module's spec
includes a slot indicating it can run safely without the GIL.
PEP 703 called the constant for the slot `Py_mod_gil_not_used`; I went
with `Py_MOD_GIL_NOT_USED` for consistency with gh-104148.
A warning will be issued up to once per interpreter for the first
GIL-using module that is loaded. If `-v` is given, a shorter message
will be printed to stderr every time a GIL-using module is loaded
(including the first one that issues a warning).
|
| |
|
|
|
| |
(#116623)
Co-authored-by: Sam Gross <colesbury@gmail.com>
|
| |
|
|
|
| |
Replace private _PyTime functions with public PyTime functions.
random_seed_time_pid() now reports errors to its caller.
|
| |
|
|
|
| |
Add socket.SO_BINDTOIFINDEX constant
This socket option avoids a race condition between SO_BINDTODEVICE and network interface renaming.
|
| |
|
|
|
| |
<pycore_time.h> include is no longer needed to get the PyTime_t type
in internal header files. This type is now provided by <Python.h>
include. Add <pycore_time.h> includes to C files instead.
|
| |
|
|
|
| |
Run command:
sed -i -e 's!\<_PyTime_t\>!PyTime_t!g' $(find -name "*.c" -o -name "*.h")
|
| |
|
|
|
| |
* Fix a crash when pass UINT_MAX.
* Fix an integer overflow on 64-bit non-Windows platforms.
|
| |
|
| |
Add getnameinfo extension NI_IDN flag.
|
| |
|
|
|
|
|
| |
_PyDict_Pop_KnownHash(): remove the default value and the return type
becomes an int.
Co-authored-by: Stefan Behnel <stefan_ml@behnel.de>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
|
| | |
|
| |
|
|
|
|
|
|
| |
* gh-106320: Re-add _PyLong_FromByteArray(), _PyLong_AsByteArray() and _PyLong_GCD() to the public header files since they are used by third-party packages and there is no efficient replacement.
See https://github.com/python/cpython/issues/111140
See https://github.com/python/cpython/issues/111139
* gh-111262: Re-add _PyDict_Pop() to have a C-API until a new public one is designed.
|
| | |
|
| | |
|
| | |
|