summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-30248: Convert boolean arguments only once in _json. (#1423)Serhiy Storchaka2017-05-281-40/+24
| | | | | Rather than saving the Python object and calling PyObject_IsTrue() every time when the boolean argument is used, call it only once and save C boolean value.
* bpo-20210: Support the *disabled* marker in Setup files (GH-132)xdegaye2017-05-272-13/+37
| | | | | Extension modules listed after the *disabled* marker are not built at all, neither by the Makefile nor by setup.py.
* bpo-16500: Allow registering at-fork handlers (#1715)Antoine Pitrou2017-05-274-59/+212
| | | | | | | | | | | | * bpo-16500: Allow registering at-fork handlers * Address Serhiy's comments * Add doc for new C API * Add doc for new Python-facing function * Add NEWS entry + doc nit
* bpo-9146: Raise a ValueError if OpenSSL fails to init a hash func. (#1777)Gregory P. Smith2017-05-241-9/+36
| | | | This helps people in weird FIPS mode environments where common things like MD5 are not available in the binary as a matter of policy.
* bpo-22257: Private C-API for main interpreter initialization (PEP 432). (#1729)Eric Snow2017-05-241-2/+15
| | | (patch by Nick Coghlan)
* bpo-22257: Private C-API for core runtime initialization (PEP 432). (#1772)Eric Snow2017-05-241-16/+19
| | | (patch by Nick Coghlan)
* bpo-29334: Fix ssl.getpeercert for auto-handshake (#1769)Christian Heimes2017-05-231-19/+11
| | | | | | | | | | | | Drop handshake_done and peer_cert members from PySSLSocket struct. The peer certificate can be acquired from *SSL directly. SSL_get_peer_certificate() does not trigger any network activity. Instead of manually tracking the handshake state, simply use SSL_is_init_finished(). In combination these changes fix auto-handshake for non-blocking MemoryBIO connections. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-22257: Fix CLI by using int instead of char (compares to EOF). (#1765)Eric Snow2017-05-231-1/+1
|
* bpo-22257: Small changes for PEP 432. (#1728)Eric Snow2017-05-231-107/+180
| | | PEP 432 specifies a number of large changes to interpreter startup code, including exposing a cleaner C-API. The major changes depend on a number of smaller changes. This patch includes all those smaller changes.
* bpo-30003: Fix handling escape characters in HZ codec (#1556)Xiang Zhang2017-05-221-13/+12
|
* bpo-29619: Do not use HAVE_LARGEFILE_SUPPORT for type conversions (GH-1666).xdegaye2017-05-221-18/+5
| | | | | | bpo-29619: Do not use HAVE_LARGEFILE_SUPPORT for type conversions (GH-1666). * Use only the LongLong form for the conversions.
* bpo-30039: Don't run signal handlers while resuming a yield from stack (#1081)Nathaniel J. Smith2017-05-171-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we have a chain of generators/coroutines that are 'yield from'ing each other, then resuming the stack works like: - call send() on the outermost generator - this enters _PyEval_EvalFrameDefault, which re-executes the YIELD_FROM opcode - which calls send() on the next generator - which enters _PyEval_EvalFrameDefault, which re-executes the YIELD_FROM opcode - ...etc. However, every time we enter _PyEval_EvalFrameDefault, the first thing we do is to check for pending signals, and if there are any then we run the signal handler. And if it raises an exception, then we immediately propagate that exception *instead* of starting to execute bytecode. This means that e.g. a SIGINT at the wrong moment can "break the chain" – it can be raised in the middle of our yield from chain, with the bottom part of the stack abandoned for the garbage collector. The fix is pretty simple: there's already a special case in _PyEval_EvalFrameEx where it skips running signal handlers if the next opcode is SETUP_FINALLY. (I don't see how this accomplishes anything useful, but that's another story.) If we extend this check to also skip running signal handlers when the next opcode is YIELD_FROM, then that closes the hole – now the exception can only be raised at the innermost stack frame. This shouldn't have any performance implications, because the opcode check happens inside the "slow path" after we've already determined that there's a pending signal or something similar for us to process; the vast majority of the time this isn't true and the new check doesn't run at all.
* bpo-30038: fix race condition in signal delivery + wakeup fd (#1082)Nathaniel J. Smith2017-05-161-7/+26
| | | | | | | | | | | | | | | | | | | Before, it was possible to get the following sequence of events (especially on Windows, where the C-level signal handler for SIGINT is run in a separate thread): - SIGINT arrives - trip_signal is called - trip_signal writes to the wakeup fd - the main thread wakes up from select()-or-equivalent - the main thread checks for pending signals, but doesn't see any - the main thread drains the wakeup fd - the main thread goes back to sleep - trip_signal sets is_tripped=1 and calls Py_AddPendingCall to notify the main thread the it should run the Python-level signal handler - the main thread doesn't notice because it's asleep This has been causing repeated failures in the Trio test suite: https://github.com/python-trio/trio/issues/119
* bpo-30242: resolve some undefined behaviours in struct (#1418)Xiang Zhang2017-05-151-5/+9
|
* bpo-30224: remove outdated checks in struct (#1374)Xiang Zhang2017-05-151-47/+15
|
* bpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1097)INADA Naoki2017-05-111-0/+12
| | | | | | | | | | | | when there are no more `await` or `yield (from)` before return in coroutine, cancel was ignored. example: async def coro(): asyncio.Task.current_task().cancel() return 42 ... res = await coro() # should raise CancelledError
* bpo-30285: Optimize case-insensitive matching and searching (#1482)Serhiy Storchaka2017-05-092-1/+97
| | | | of regular expressions.
* bpo-29990: Fix range checking in GB18030 decoder (#1495)Xiang Zhang2017-05-091-1/+3
| | | When decoding a 4-byte GB18030 sequence, the first and third byte cannot exceed 0xFE.
* bpo-30277: Replace _sre.getlower() with _sre.ascii_tolower() and ↵Serhiy Storchaka2017-05-052-21/+57
| | | | _sre.unicode_tolower(). (#1468)
* bpo-30243: Fixed the possibility of a crash in _json. (#1420)Serhiy Storchaka2017-05-051-66/+20
| | | | | | It was possible to get a core dump by using uninitialized _json objects. Now __new__ methods create initialized objects. __init__ methods are removed.
* bpo-30215: Make re.compile() locale agnostic. (#1361)Serhiy Storchaka2017-05-053-3/+74
| | | | | | Compiled regular expression objects with the re.LOCALE flag no longer depend on the locale at compile time. Only the locale at matching time affects the result of matching.
* bpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. (#1316)Serhiy Storchaka2017-05-031-2/+2
|
* bpo-30103: Allow Uuencode in Python using backtick as zero instead of space ↵Xiang Zhang2017-05-032-11/+23
| | | | | | (#1326)
* bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux (#1370)Antoine Pitrou2017-05-021-3/+3
| | | | | | * bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux * Add NEWS entry
* bpo-30228: FileIO seek() and tell() set seekable (#1384)Victor Stinner2017-05-021-15/+21
| | | | | | | FileIO.seek() and FileIO.tell() method now set the internal seekable attribute to avoid one syscall on open() (in buffered or text mode). The seekable property is now also more reliable since its value is set correctly on memory allocation failure.
* restore *data* parameter of binascii.b2a_base64 to positional-only (#1352)Xiang Zhang2017-05-012-4/+5
|
* bpo-30101: Add support for curses.A_ITALIC. (#1015)Eijebong2017-04-261-0/+3
|
* timemodule.c: Cast PyUnicode_AsUTF8() to char* (#1294)Victor Stinner2017-04-261-1/+1
| | | | | | | | | | bpo-28769 changed PyUnicode_AsUTF8() return type from const char* to char* in Python 3.7, but tm_zone field type of the tm structure is char* on FreeBSD. Cast PyUnicode_AsUTF8() to char* in gettmarg() to fix the warning: Modules/timemodule.c:443:20: warning: assigning to 'char *' from 'const char *' discards qualifiers
* tmtotuple(): use time_t for gmtoff (#1276)Victor Stinner2017-04-241-3/+3
| | | | | | | timegm() return type is time_t, not int. Use time_t to prevent the following compiler warning on Windows: timemodule.c: warning C4244: '=': conversion from 'time_t' to 'int', possible loss of data
* bpo-29960 _random.Random corrupted on exception in setstate(). (#1019)bladebryan2017-04-221-1/+4
|
* bpo-30125: Fix faulthandler.disable() on Windows (#1240)Victor Stinner2017-04-211-24/+19
| | | | | | | | | | | | * bpo-30125: Cleanup faulthandler.c * Use size_t type for iterators * Add { ... } * bpo-30125: Fix faulthandler.disable() on Windows On Windows, faulthandler.disable() now removes the exception handler installed by faulthandler.enable().
* remove configure test for inline keyword (#1231)Benjamin Peterson2017-04-211-3/+1
| | | We require C99, so a configure test for this standard feature is not needed.
* bpo-29802: Fix reference counting in module-level struct functions (#1213)Serhiy Storchaka2017-04-201-0/+1
| | | | when pass arguments of wrong type.
* Only define get_zone() and get_gmtoff() if needed (#1193)Victor Stinner2017-04-201-0/+2
| | | | | | | | | Only define the get_zone() and get_gmtoff() private functions in the time module if these functions are needed to initialize the module. The change fixes the following warnings on AIX: Modules/timemodule.c:1175:1: warning: 'get_gmtoff' defined but not used [-Wunused-function] Modules/timemodule.c:1164:1: warning: 'get_zone' defined but not used [-Wunused-function]
* bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). (#1110)Serhiy Storchaka2017-04-191-20/+23
|
* bpo-30070: Fixed leaks and crashes in errors handling in the parser module. ↵Serhiy Storchaka2017-04-191-52/+79
| | | | (#1131)
* bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096)Serhiy Storchaka2017-04-198-34/+72
| | | | | | raised an error. Replace them with using concrete types API that never fails if appropriate.
* bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)Serhiy Storchaka2017-04-1622-89/+89
|
* bpo-10076: Compiled regular expression and match objects now are copyable. ↵Serhiy Storchaka2017-04-162-164/+19
| | | | (#1000)
* bpo-28765: Use concrete types API in _sre.c. (#1009)Serhiy Storchaka2017-04-161-37/+37
|
* bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is ↵Xiang Zhang2017-04-151-8/+17
| | | | present (#1130)
* bpo-29738: Fix memory leak in _get_crl_dp (GH-526)Olivier Vielpeau2017-04-151-7/+1
| | | | | | | | | * Remove conditional on free of `dps`, since `dps` is now allocated for all versions of OpenSSL * Remove call to `x509_check_ca` since it was only used to cache the `crldp` field of the certificate CRL_DIST_POINTS_free is available in all supported versions of OpenSSL (recent 0.9.8+) and LibreSSL.
* convert from long long to PyLong loselessly (#1106)Benjamin Peterson2017-04-131-1/+1
|
* Expand the PySlice_GetIndicesEx macro. (#1023)Serhiy Storchaka2017-04-085-25/+24
|
* bpo-29962: add math.remainder (#950)Mark Dickinson2017-04-051-0/+103
| | | | | | | | | | | | | | * Implement math.remainder. * Fix markup for arguments; use double spaces after period. * Mark up function reference in what's new entry. * Add comment explaining the calculation in the final branch. * Fix out-of-order entry in whatsnew. * Add comment explaining why it's good enough to compare m with c, in spite of possible rounding error.
* bpo-29649: Improve struct.pack_into() boundary error messages (#424)Andrew Nester2017-04-041-4/+30
|
* Correct typo (#976)Angus Hollands2017-04-031-1/+1
|
* bpo-29953: Fix memory leaks in the replace() method of datetime and time (#927)Serhiy Storchaka2017-03-311-11/+10
| | | objects when pass out of bound fold argument.
* suppress compiler warnings in _ctypes_test (#902)Benjamin Peterson2017-03-311-3/+3
| | | Changed test code to suppress a compiler warning, while taking care to avoid the code being optimized out by the compiler.
* bpo-29946: Fix "sqrtpi defined but not used" (#908)Louie Lu2017-03-301-1/+3
|