summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [3.6] bpo-30650: Fixed a syntax error: missed right parentheses (GH-2154) ↵Serhiy Storchaka2017-06-151-1/+1
| | | | | (#2215) (cherry picked from commit 0d32218)
* bpo-29591: Upgrade Modules/expat to libexpat 2.2 (#2164) (#2200)Victor Stinner2017-06-1413-476/+523
| | | | | | | | | | | | | | | | | | | | | | * bpo-29591: Upgrade Modules/expat to libexpat 2.2 * bpo-29591: Restore Python changes on expat * bpo-29591: Remove expat config of unsupported platforms Remove the configuration (Modules/expat/*config.h) of unsupported platforms: * Amiga * MacOS Classic on PPC32 * Open Watcom * bpo-29591: Remove useless XML_HAS_SET_HASH_SALT The XML_HAS_SET_HASH_SALT define of Modules/expat/expat.h became useless since our local expat copy was upgrade to expat 2.1 (it's now expat 2.2.0). (cherry picked from commit 23ec4b57e1359f9c539b8defc317542173ae087e)
* [3.6] bpo-28994: Fixed errors handling in atexit._run_exitfuncs(). (GH-2034) ↵Serhiy Storchaka2017-06-121-1/+1
| | | | | | (#2121) The traceback no longer displayed for SystemExit raised in a callback registered by atexit.. (cherry picked from commit 3fd54d4a7e604067e2bc0f8cfd58bdbdc09fa7f4)
* bpo-30508: Don't log exceptions if Task/Future "cancel()" method was called. ↵Yury Selivanov2017-06-111-1/+17
| | | | (#2109)
* [3.6] bpo-27425: Be more explicit in .gitattributes (GH-840) (GH-2083)Zachary Ware2017-06-101-111/+111
| | | Also updates checked-in line endings on some files
* [3.6] Regenerate Argument Clinic code for bpo-19180. (GH-2073). (#2077)Serhiy Storchaka2017-06-102-2/+2
| | | | (cherry picked from commit 5f31d5cf6efa8c304d352e34f9f2a1ed0074298e)
* bpo-30038: fix race condition in signal delivery + wakeup fd (#1082) (#2075)Victor Stinner2017-06-101-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 (cherry picked from commit 4ae01496971624c75080431806ed1c08e00f22c7)
* [3.6] bpo-30039: Don't run signal handlers while resuming a yield from stack ↵Yury Selivanov2017-06-091-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-1081) (#1640) 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.. (cherry picked from commit ab4413a7e9bda95b6fcd517073e2a51dafaa1624)
* bpo-30524: Write unit tests for FASTCALL (#2022) (#2030)Victor Stinner2017-06-091-0/+101
| | | | | | | | Test C functions: * _PyObject_FastCall() * _PyObject_FastCallDict() * _PyObject_FastCallKeywords() (cherry picked from commit 3b5cf85edc188345668f987c824a2acb338a7816)
* [3.6] bpo-19180: Updated references for RFC 1750, RFC 3280 & RFC 4366Nick Coghlan2017-06-092-2/+2
| | | | | | * RFC 1750 has been been obsoleted by RFC 4086. * RFC 3280 has been obsoleted by RFC 5280. * RFC 4366 has been obsoleted by RFC 6066. (cherry picked from commit 63c2c8ac17750ba2be2cfc4e339cae1f4edee54f)
* bpo-30601: Fix a refleak in WindowsConsoleIO (#2003) (#2008)Victor Stinner2017-06-081-3/+2
| | | | | | Fix a reference leak in _io._WindowsConsoleIO: PyUnicode_FSDecoder() always initialize decodedname when it succeed and it doesn't clear input decodedname object. (cherry picked from commit 29adc13bd797d9c9e7fcb893a7c49ce7f7ad388c)
* [3.6] bpo-30594: Fixed refcounting in newPySSLSocket (GH-1992) (#1994)Nathaniel J. Smith2017-06-081-2/+1
| | | | If pass a server_hostname= that fails IDNA decoding to SSLContext.wrap_socket or SSLContext.wrap_bio, then the SSLContext object had a spurious Py_DECREF called on it, eventually leading to segfaults. (cherry picked from commit 65ece7ca2366308fa91a39a8dfa255e6bdce3cca)
* [3.6] bpo-30557: faulthandler now correctly filters and displays exception ↵Steve Dower2017-06-061-4/+4
| | | | | | | | | | | | | | | | | … (#1960) * bpo-30557: faulthandler now correctly filters and displays exception codes on Windows (#1924) * bpo-30557: faulthandler now correctly filters and displays exception codes on Windows * Adds test for non-fatal exceptions. * Adds bpo number to comment. * bpo-30557: Fix test_faulthandler (#1969) On Windows 8, 8.1 and 10 at least, the exit code is the exception code (no bit is cleared).
* bpo-30544: _io._WindowsConsoleIO.write raises the wrong error when ↵Steve Dower2017-06-021-1/+1
| | | | | | | WriteConsoleW fails (#1912) (#1925) * bpo-30544: _io._WindowsConsoleIO.write raises the wrong error when WriteConsoleW fails * bpo-30544: _io._WindowsConsoleIO.write raises the wrong error when WriteConsoleW fails
* [3.6] bpo-29960 _random.Random corrupted on exception in setstate(). … (#1287)Mariatta2017-05-271-1/+4
| | | (cherry picked from commit 9616a82e7802241a4b74cf7ae38d43c37bf66e48)
* bpo-30003: Fix handling escape characters in HZ codec (#1556) (#1719)Xiang Zhang2017-05-221-13/+12
|
* tmtotuple(): use time_t for gmtoff (#1276) (#1635)Victor Stinner2017-05-171-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 (cherry picked from commit 0d659e5614cad512a1940125135b443b3eecb5d7)
* bpo-30242: resolve some undefined behaviours in struct (#1418) (#1586)Xiang Zhang2017-05-151-5/+9
|
* bpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1546)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 (cherry picked from commit 991adca012f5e106c2d4040ce619c696ba6f9c46)
* bpo-29990: Fix range checking in GB18030 decoder (#1495) (#1507)Xiang Zhang2017-05-091-1/+3
| | | When decoding a 4-byte GB18030 sequence, the first and third byte cannot exceed 0xFE.
* [3.6] bpo-30243: Fixed the possibility of a crash in _json. (GH-1420) (#1469)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.. (cherry picked from commit 76a3e51a403bc84ed536921866c86dd7d07aaa7e)
* [3.6] bpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. ↵Serhiy Storchaka2017-05-041-2/+2
| | | | | (GH-1316). (#1441) (cherry picked from commit 5f161fd86dd5bb936a1a2a13391b13b7e59ec201)
* Backport bpo-30205 to 3.6 (#1403)Antoine Pitrou2017-05-021-3/+3
|
* bpo-30125: Fix faulthandler.disable() on Windows (#1243)Victor Stinner2017-04-211-2/+11
| | | | On Windows, faulthandler.disable() now removes the exception handler installed by faulthandler.enable().
* [3.6] bpo-30065: Fixed arguments validation in _posixsubprocess.fork_exec(). ↵Serhiy Storchaka2017-04-191-20/+23
| | | | | (GH-1110) (#1186) (cherry picked from commit 66bffd1)
* [3.6] bpo-30070: Fixed leaks and crashes in errors handling in the parser ↵Serhiy Storchaka2017-04-191-52/+79
| | | | | module. (GH-1131). (#1184) (cherry picked from commit a79f4c219531c05fc8f670c1e4bbf12c081935d3)
* bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() ↵Serhiy Storchaka2017-04-194-28/+65
| | | | | | | (#1096) (#1180) raised an error. (cherry picked from commit bf623ae8843dc30b28c574bec8d29fc14be59d86)
* bpo-30068: add missing iter(self) in _io._IOBase.readlines when hint is ↵Xiang Zhang2017-04-151-8/+17
| | | | present (#1130) (#1150)
* [3.6] bpo-29738: Fix memory leak in _get_crl_dp (GH-526) (GH-1142)Mariatta2017-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. (cherry picked from commit 2849cc34a8db93d448a62d69c462402347b50dcb)
* convert from long long to PyLong loselessly (#1106) (#1121)Benjamin Peterson2017-04-131-1/+1
|
* Expand the PySlice_GetIndicesEx macro. (#1023) (#1044)Serhiy Storchaka2017-04-085-25/+24
| | | (cherry picked from commit b879fe82e7e5c3f7673c9a7fa4aad42bd05445d8)
* bpo-29939: suppress compiler warnings in _ctypes_test (#1038)Vinay Sajip2017-04-071-3/+3
| | | | bpo-29939: Changed test code to suppress a compiler warning, while taking care to avoid the code being optimized out by the compiler. (cherry picked from commit 164d30eb1e66575dafee6af4fca4cbf52c7fbe6a)
* bpo-29953: Fix memory leaks in the replace() method of datetime and t… (#933)Serhiy Storchaka2017-03-311-11/+10
| | | | | objects when pass out of bound fold argument. (cherry picked from commit 314d6fca36a4eaa0541218431d14804fadec6488)
* bpo-29942: Fix the use of recursion in itertools.chain.from_iterable. (#911)T. Wouters2017-03-301-24/+28
| | | | | | | | | * bpo-29942: Fix the use of recursion in itertools.chain.from_iterable. Fix the use of recursion in itertools.chain.from_iterable. Using recursion is unnecessary, and can easily cause stack overflows, especially when building in low optimization modes or with Py_DEBUG enabled. (cherry picked from commit 5466d4af5fe76ec0a5fbc8a05675287d9e8e9d14)
* bpo-29935: Fixed error messages in the index() method of tuple, list and ↵Serhiy Storchaka2017-03-301-2/+2
| | | | | | deque (#887) (#907) when pass indices of wrong type. (cherry picked from commit d4edfc9abffca965e76ebc5957a92031a4d6c4d4)
* bpo-27863: Fixed multiple crashes in ElementTree. (#765) (#903)Serhiy Storchaka2017-03-301-48/+52
| | | | (cherry picked from commit 576def096ec7b64814e038f03290031f172886c3)
* faulthandler: Restore the old sigaltstack during teardown (GH-777) (GH-797)Christophe Zeitouny2017-03-241-1/+16
| | | (cherry picked from commit 20fbf8accd494fd15b0fc4c84928178c71ead4d1)
* bpo-25455: Fixed crashes in repr of recursive buffered file-like objects. ↵Serhiy Storchaka2017-03-193-8/+45
| | | | | (#514) (#722) (cherry picked from commit a5af6e1af77ee0f9294c5776478a9c24d9fbab94)
* Add sockaddr_alg to sock_addr_t (GH-234) (GH-533)Mariatta2017-03-172-30/+34
| | | (cherry picked from commit d37c068e695f8ec72b5c1b5a5a5ece2337fda768)
* bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords ↵Michael Seifert2017-03-151-1/+4
| | | | are not strings (#649) (#671)
* [3.6] bpo-29723: Consistently configure sys.path[0] (#636)Nick Coghlan2017-03-121-28/+44
| | | | | | | | | | | | | | | | | | | | | | | | Directory and zipfile execution previously added the parent directory of the directory or zipfile as sys.path[0] and then subsequently overwrote it with the directory or zipfile itself. This caused problems in isolated mode, as it overwrote the "stdlib as a zip archive" entry in sys.path, as the parent directory was never added. The attempted fix to that issue in bpo-29319 created the opposite problem in *non*-isolated mode, by potentially leaving the parent directory on sys.path instead of overwriting it. This change fixes the root cause of the problem by removing the whole "add-and-overwrite" dance for sys.path[0], and instead simply never adds the parent directory to sys.path in the first place. (cherry picked from commit d2977a3ae2cc6802921b1e3b6e9d13fcfbda872d)
* bpo-29770: remove outdated PYO related info (GH-590) (GH-612)Xiang Zhang2017-03-112-4/+4
|
* bpo-29619: Convert st_ino using unsigned integer (#557) (#584)Victor Stinner2017-03-091-5/+8
| | | | | | | bpo-29619: os.stat() and os.DirEntry.inodeo() now convert inode (st_ino) using unsigned integers. (cherry picked from commit 0f6d73343d342c106cda2219ebb8a6f0c4bd9b3c) (Misc/NEWS conflict handled manually.)
* [3.6] bpo-28298: make array 'Q', 'L' and 'I' accept big intables as elements ↵orenmn2017-03-091-46/+62
| | | | (#579)
* [3.6] bpo-29768: Fixed compile-time check for expat version. (#576)Serhiy Storchaka2017-03-091-1/+1
| | | | (cherry picked from commit 22e707fa04476710ba5cc7e2206e4ac66743931b)
* bpo-29176: Fix name of the _curses.window class (#52) (#532)Mariatta2017-03-081-1/+1
| | | | | Set name to "_curses.window" instead of "_curses.curses window" (with a space!?). (cherry picked from commit 61e2bc74dfab1ceee332d3f480dcf86c478c87c5)
* [3.6] bpo-27593: Get SCM build info from git instead of hg. (#446) (#454)Ned Deily2017-03-041-23/+23
| | | | | | | | | | | * bpo-27593: Get SCM build info from git instead of hg. (#446) sys.version and the platform module python_build(), python_branch(), and python_revision() functions now use git information rather than hg when building from a repo. Based on original patches by Brett Cannon and Steve Dower. (cherry picked from commit 5c4b0d063aba0a68c325073f5f312a2c9f40d178)
* bpo-28963: Fix out of bound iteration in ↵Yury Selivanov2017-03-031-1/+1
| | | | asyncio.Future.remove_done_callback/C (#408)
* bpo-29271: Fix Task.current_task and Task.all_tasks to accept None. (#406)Yury Selivanov2017-03-032-11/+11
|
* bpo-29697: Don't use OpenSSL <1.0.2 fallback on 1.1+ (#397)Donald Stufft2017-03-021-2/+2
|