summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [3.7] Fix duplicating words words. (GH-6296) (GH-6297)Serhiy Storchaka2018-03-281-1/+1
| | | | | Most of them have been added in 3.7. (cherry picked from commit bac2d5ba30339298db7d4caa9c8cd31d807cf081)
* bpo-32844: Fix a subprocess misredirection of a low fd (GH5689)Miss Islington (bot)2018-03-261-1/+1
| | | | | | | | | | | | | bpo-32844: subprocess: Fix a potential misredirection of a low fd to stderr. When redirecting, subprocess attempts to achieve the following state: each fd to be redirected to is less than or equal to the fd it is redirected from, which is necessary because redirection occurs in the ascending order of destination descriptors. It fails to do so in a couple of corner cases, for example, if 1 is redirected to 2 and 0 is closed in the parent. (cherry picked from commit 0e7144b064a19493a146af94175a087b3888c37b) Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
* Fix error message in sqlite connection thread check. (GH-6028)Miss Islington (bot)2018-03-261-2/+2
| | | | | (cherry picked from commit 030345c0bfc2f76684666fe5c61e766ba5debfe6) Co-authored-by: Takuya Akiba <469803+iwiwi@users.noreply.github.com>
* [3.7] bpo-33136: Harden ssl module against CVE-2018-8970 (GH-6229) (GH-6230)Miss Islington (bot)2018-03-251-3/+4
| | | | | | | | | | Harden ssl module against LibreSSL CVE-2018-8970. X509_VERIFY_PARAM_set1_host() is called with an explicit namelen. A new test ensures that NULL bytes are not allowed. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit d02ac25ab0879f1a6de6937573bf00a16b7bd22e) Co-authored-by: Christian Heimes <christian@python.org>
* [3.7] bpo-33127: Compatibility patch for LibreSSL 2.7.0 (GH-6210) (GH-6213)Miss Islington (bot)2018-03-241-6/+16
| | | | | | | | | | | | | LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and LibreSSL < 2.7. Documentation updates and fixes for failing tests will be provided in another patch set. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 4ca0739c9d97ac7cd45499e0d31be68dc659d0e1) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-32999: ast: Convert useless check to assert (GH-6197)Miss Islington (bot)2018-03-231-3/+1
| | | | | (cherry picked from commit c65bf3fe4a2bde424b79e350f36b7aaa3f6476f6) Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
* bpo-32999: Revert GH-6002 (fc7df0e6) (GH-6189) (GH-6190)Miss Islington (bot)2018-03-221-24/+11
| | | | | | | bpo-33018 (GH-5944) fixed bpo-32999 too. So fc7df0e6 is not required anymore. Revert it except test case. (cherry picked from commit f757b72b2524ce3451d2269f0b8a9f0593a7b27f) Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
* bpo-33018: Improve issubclass() error checking and message. (GH-5944)Miss Islington (bot)2018-03-221-0/+5
| | | | | | | This improves error message for situations when a non-class is checked w.r.t. an abstract base class. (cherry picked from commit 40472dd42de4f7265d456458cd13ad6894d736db) Co-authored-by: jab <jab@users.noreply.github.com>
* Fix typos in mmap() error messages (GH-6173)Miss Islington (bot)2018-03-211-2/+2
| | | | | (cherry picked from commit 9308dea3e1fd565d50a76a667e4e8ef0568b7053) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.7] bpo-33021: Release the GIL during fstat() calls (GH-6019) (GH-6159)Miss Islington (bot)2018-03-201-2/+9
| | | | | | | | | | | | | | | | fstat may block for long time if the file descriptor is on a non-responsive NFS server, hanging all threads. Most fstat() calls are handled by _Py_fstat(), releasing the GIL internally, but but _Py_fstat_noraise() does not release the GIL, and most calls release the GIL explicitly around it. This patch fixes last 2 calls to _Py_fstat_no_raise(), avoiding hangs when calling: - mmap.mmap() - os.urandom() - random.seed() (cherry picked from commit 4484f9dca9149da135bbae035f10a50d20d1cbbb) Co-authored-by: Nir Soffer <nirsof@gmail.com>
* bpo-27645: Fix version number in 'database in transaction' fallback (GH-6131)Miss Islington (bot)2018-03-181-2/+2
| | | | | | | It was actually fixed in SQLite 3.8.8, not 3.8.7. (cherry picked from commit bbf7bb7a636b3112ef6f6b31df385606d52517ce) Co-authored-by: Aviv Palivoda <palaviv@gmail.com>
* bpo-32374: m_traverse may be called with m_state=NULL (GH-5140)Miss Islington (bot)2018-03-171-3/+49
| | | | | | | | Multi-phase initialized modules allow m_traverse to be called while the module is still being initialized, so module authors may need to account for that. (cherry picked from commit c2b0b12d1a137ada1023ab7c10b8d9a0249d95f9) Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
* bpo-27645: Add support for native backup facility of SQLite (GH-4238)Miss Islington (bot)2018-03-102-0/+142
| | | | | (cherry picked from commit d7aed4102d2a40c74553240c7f03585624d27aea) Co-authored-by: Emanuele Gaifas <lelegaifax@gmail.com>
* bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname ↵Miss Islington (bot)2018-03-081-42/+32
| | | | | | | (GH-6010) (cherry picked from commit 3b20d3454e8082e07dba93617793de5dc9237828) Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
* bpo-32999: Fix ABC.__subclasscheck__ crash (GH-6002)Miss Islington (bot)2018-03-071-12/+25
| | | | | (cherry picked from commit fc7df0e664198cb05cafd972f190a18ca422989c) Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
* bpo-32969: Expose some missing constants in zlib and fix the doc (GH-5988)Miss Islington (bot)2018-03-071-3/+18
| | | | | (cherry picked from commit bc3f2289b9007396bfb7f986bee477b6176c1822) Co-authored-by: Xiang Zhang <angwerzx@126.com>
* bpo-33001: Prevent buffer overrun in os.symlink (GH-5989)Miss Islington (bot)2018-03-051-28/+38
| | | | | (cherry picked from commit 6921e73e33edc3c61bc2d78ed558eaa22a89a564) Co-authored-by: Steve Dower <steve.dower@microsoft.com>
* bpo-32903: Fix a memory leak in os.chdir() on Windows (GH-5801) (#5945)Miss Islington (bot)2018-03-011-7/+7
| | | | | (cherry picked from commit 3e197c7a6740d564ad52fb7901c07d5ff49460f5) Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
* bpo-31453: Add setter for min/max protocol version (GH-5259)Miss Islington (bot)2018-02-271-22/+212
| | | | | | | | | | | | | | | OpenSSL 1.1 has introduced a new API to set the minimum and maximum supported protocol version. The API is easier to use than the old OP_NO_TLS1 option flags, too. Since OpenSSL has no call to set minimum version to highest supported, the implementation emulate maximum_version = MINIMUM_SUPPORTED and minimum_version = MAXIMUM_SUPPORTED by figuring out the minumum and maximum supported version at compile time. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 698dde16f60729d9e3f53c23a4ddb8e5ffe818bf) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-32947: OpenSSL 1.1.1-pre1 / TLS 1.3 fixes (GH-5663)Miss Islington (bot)2018-02-271-0/+4
| | | | | | | | | | | | | | | | | | | | * bpo-32947: OpenSSL 1.1.1-pre1 / TLS 1.3 fixes Misc fixes and workarounds for compatibility with OpenSSL 1.1.1-pre1 and TLS 1.3 support. With OpenSSL 1.1.1, Python negotiates TLS 1.3 by default. Some test cases only apply to TLS 1.2. Other tests currently fail because the threaded or async test servers stop after failure. I'm going to address these issues when OpenSSL 1.1.1 reaches beta. OpenSSL 1.1.1 has added a new option OP_ENABLE_MIDDLEBOX_COMPAT for TLS 1.3. The feature is enabled by default for maximum compatibility with broken middle boxes. Users should be able to disable the hack and CPython's test suite needs it to verify default options. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 05d9fe32a1245b9a798e49e0c1eb91f110935b69) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-32394: Remove some TCP options on old version Windows. (GH-5523)Miss Islington (bot)2018-02-261-0/+70
| | | | | (cherry picked from commit 19e7d48ce89422091f9af93038b9fee075d46e9e) Co-authored-by: animalize <animalize@users.noreply.github.com>
* bpo-32922: dbm.open() now encodes filename with the filesystem encoding. ↵Miss Islington (bot)2018-02-264-18/+45
| | | | | | | (GH-5832) (cherry picked from commit 6f600ff1734ca2fdcdd37a809adf8130f0d8cc4e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-32622: Native sendfile on windows (GH-5565)Miss Islington (bot)2018-02-251-2/+62
| | | | | | * Support sendfile on Windows Proactor event loop naively. (cherry picked from commit a19fb3c6aaa7632410d1d9dcb395d7101d124da4) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* [3.7] bpo-30622: Fix NPN for OpenSSL 1.1.1-pre1 (GH-5876) (#5880)Miss Islington (bot)2018-02-252-25/+30
| | | | | | Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 29eab55309b9f78b79074d26db16a44e7841c639) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-17232: Clarify docs for -O and -OO command line options (GH-5839)Miss Islington (bot)2018-02-251-2/+4
| | | | | | The 'optimization' is for space in the executable file, not for run time. (cherry picked from commit 186b606d8a2ea4fd51b7286813302c8e8c7006cc) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* [3.7] bpo-30622: Improve NPN support detection (GH-5859) (#5860)Miss Islington (bot)2018-02-242-11/+24
| | | | | | | | | The ssl module now detects missing NPN support in LibreSSL. Co-Authored-By: Bernard Spil <brnrd@FreeBSD.org> Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 6cdb7954b0a578d899e4b78b868ea59eef08480a) Co-authored-by: Christian Heimes <christian@python.org>
* [3.7] bpo-24334: Cleanup SSLSocket (GH-5252) (#5857)Miss Islington (bot)2018-02-242-63/+113
| | | | | | | | | | | | | | | | * The SSLSocket is no longer implemented on top of SSLObject to avoid an extra level of indirection. * Owner and session are now handled in the internal constructor. * _ssl._SSLSocket now uses the same method names as SSLSocket and SSLObject. * Channel binding type check is now handled in C code. Channel binding is always available. The patch also changes the signature of SSLObject.__init__(). In my opinion it's fine. A SSLObject is not a user-constructable object. SSLContext.wrap_bio() is the only valid factory. (cherry picked from commit 141c5e8c2437a9fed95a04c81e400ef725592a17) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. (GH-5754)Miss Islington (bot)2018-02-241-0/+3
| | | | | (cherry picked from commit 42c35d9c0c8175332f50fbe034a001fe52f057b9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [bpo-28414] Make all hostnames in SSL module IDN A-labels (GH-5128) (GH-5843)Miss Islington (bot)2018-02-242-68/+78
| | | | | | | | | | | | | | | Previously, the ssl module stored international domain names (IDNs) as U-labels. This is problematic for a number of reasons -- for example, it made it impossible for users to use a different version of IDNA than the one built into Python. After this change, we always convert to A-labels as soon as possible, and use them for all internal processing. In particular, server_hostname attribute is now an A-label, and on the server side there's a new sni_callback that receives the SNI servername as an A-label rather than a U-label. (cherry picked from commit 11a1493bc4198f1def5e572049485779cf54dc57) Co-authored-by: Christian Heimes <christian@python.org>
* Test that new_timezone can return the UTC singleton (gh-5318) (#5819)Miss Islington (bot)2018-02-221-0/+24
| | | | | (cherry picked from commit a049f5790e38fe1b1ba1d4c10ed5ab35150806fa) Co-authored-by: Paul Ganssle <pganssle@users.noreply.github.com>
* bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage ↵Miss Islington (bot)2018-02-222-48/+72
| | | | | | | now correctly convert from bytes. (GH-5761) (cherry picked from commit 23ad6d0d1a7a6145a01494f4f3913a63d1f0250c) Co-authored-by: Steve Dower <steve.dower@microsoft.com>
* bpo-32604: Swap threads only if the interpreter is different. (gh-5783)Miss Islington (bot)2018-02-211-8/+14
| | | | | | The CPython runtime assumes that there is a one-to-one relationship (for a given interpreter) between PyThreadState and OS threads. Sending and receiving on a channel in the same interpreter was causing crashes because of this (specifically due to a check in PyThreadState_Swap()). The solution is to not switch threads if the interpreter is the same. (cherry picked from commit f53d9f2778a87bdd48eb9030f782a4ebf9e7622f) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* closes bpo-32859: Don't retry dup3() if it is not available at runtime (GH-5708)Miss Islington (bot)2018-02-201-1/+1
| | | | | | | | | | | os.dup2() tests for dup3() system call availability at runtime, but doesn't remember the result across calls, repeating the test on each call with inheritable=False. Since the caller of os.dup2() is expected to hold the GIL, fix this by making the variable holding the test result static. (cherry picked from commit b3caf388a0418f6c031e4dbdcc0c1ce7e5cc36bd) Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
* bpo-25988: Emit a warning when use or import ABCs from 'collections'. (GH-5734)Ivan Levkivskyi2018-02-181-1/+5
|
* bpo-31333: Re-implement ABCMeta in C (GH-5733)Ivan Levkivskyi2018-02-183-0/+985
| | | | This adds C versions of methods used by ABCMeta that improve performance of various ABC operations.
* bpo-32604: Clean up created subinterpreters before runtime finalization. ↵Miss Islington (bot)2018-02-171-21/+276
| | | | | | | (gh-5710) (cherry picked from commit 4c6955e2b0ccf88c705f8d1fac685a8e65f9699e) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* Update comment in posixmodule.c (GH-5681)Miss Islington (bot)2018-02-141-1/+1
| | | | | | | | A closing parentheses was missing. Signed-off-by: Ngie Cooper <yaneurabeya@gmail.com> (cherry picked from commit 7745ec4e356ac1f4eaf43b155f4482c20a907d48) Co-authored-by: ngie-eign <1574099+ngie-eign@users.noreply.github.com>
* bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995)Miss Islington (bot)2018-02-134-13/+23
| | | | | (cherry picked from commit d019bc8319ea35e93bf4baa38098ff1b57cd3ee5) Co-authored-by: Oren Milman <orenmn@gmail.com>
* bpo-29248: Fix os.readlink() on Windows (GH-5577)Miss Islington (bot)2018-02-121-3/+3
| | | | | | | The PrintNameOffset field of the reparse data buffer was treated as a number of characters instead of bytes. (cherry picked from commit 3c34aad4e7a95913ec7db8e5e948a8fc69047bf7) Co-authored-by: SSE4 <tomskside@gmail.com>
* bpo-32221: makeipaddr(): remove interface part + speedup (GH-5449) (GH-5449) ↵Miss Islington (bot)2018-02-121-28/+31
| | | | | | | (#5641) (cherry picked from commit 7766b96ab80b04509bbac708ee5ecf3c1c5934fc) Co-authored-by: Коренберг Марк <socketpair@gmail.com>
* Fix some warnings produced by different compilers. (GH-5593) (GH-5600)Miss Islington (bot)2018-02-093-2/+14
| | | | | (cherry picked from commit bfe4fd5f2e96e72eecb5b8a0c7df0ac1689f3b7e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560) ↵Miss Islington (bot)2018-02-061-4/+4
| | | | | | | | | | | | (GH-5562) Fix a rare but potential pre-exec child process deadlock in subprocess on POSIX systems when marking file descriptors inheritable on exec in the child process. This bug appears to have been introduced in 3.4 with the inheritable file descriptors support. This also changes Python/fileutils.c `set_inheritable` to use the "slow" two `fcntl` syscall path instead of the "fast" single `ioctl` syscall path when asked to be async signal safe (by way of being asked not to raise exceptions). `ioctl` is not a POSIX async-signal-safe approved function. ref: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html (cherry picked from commit c1e46e94de38a92f98736af9a42d89c3975a9919) Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
* [3.7] bpo-32746: Fix multiple typos (GH-5144) (GH-5520)Miss Islington (bot)2018-02-046-6/+6
| | | | | | Fix typos found by codespell in docs, docstrings, and comments. (cherry picked from commit c3d9508ff22ece9a96892b628dd5813e2fb0cd80) Co-authored-by: Leo Arias <leo.arias@canonical.com>
* bpo-32604: Fix memory leaks in the new _xxsubinterpreters module. (GH-5507)Miss Islington (bot)2018-02-031-268/+596
| | | | | (cherry picked from commit 4e9da0d163731caa79811c723c703ee416c31826) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* Revert "bpo-31356: Add context manager to temporarily disable GC GH-5495 (#5496)Miss Islington (bot)2018-02-021-106/+0
| | | | | | | | | This reverts commit 72a0d218dcc94a3cc409a9ef32dfcd5a7bbcb43c. The reverted commit had a few issues so it was unanimously decided to undo it. See the bpo issue for details. (cherry picked from commit 383b32fe108ea627699cc9c644fba5f8bae95d73) Co-authored-by: Yury Selivanov <yury@magic.io>
* bpo-28914: Fix compilation of select on Android (#5447)Victor Stinner2018-01-301-0/+3
| | | | | EPOLL_CLOEXEC is not defined on Android. Co-Authored-By: Wataru Matsumoto <sxsns243@gmail.com>
* bpo-32681: Fix an uninitialized variable in the C implementation of os.dup2 ↵Stéphane Wirtel2018-01-301-1/+1
| | | | | (GH-5346) See https://bugs.python.org/issue32441 for where this was introduced.
* bpo-32604: NULL-terminate kwlist in channel_drop_interpreter(). (gh-5437)Eric Snow2018-01-301-1/+1
|
* bpo-32604: Expose the subinterpreters C-API in a "private" stdlib module. ↵Eric Snow2018-01-301-0/+2061
| | | | | (gh-1748) The module is primarily intended for internal use in the test suite. Building the module under Windows will come in a follow-up PR.
* bpo-28134: Auto-detect socket values from file descriptor (#1349)Christian Heimes2018-01-291-2/+69
| | | | | | | | | | | | | | | Fix socket(fileno=fd) by auto-detecting the socket's family, type, and proto from the file descriptor. The auto-detection can be overruled by passing in family, type, and proto explicitly. Without the fix, all socket except for TCP/IP over IPv4 are basically broken: >>> s = socket.create_connection(('www.python.org', 443)) >>> s <socket.socket fd=3, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('2003:58:bc4a:3b00:56ee:75ff:fe47:ca7b', 59730, 0, 0), raddr=('2a04:4e42:1b::223', 443, 0, 0)> >>> socket.socket(fileno=s.fileno()) <socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('2003:58:bc4a:3b00::%2550471192', 59730, 0, 2550471192), raddr=('2a04:4e42:1b:0:700c:e70b:ff7f:0%2550471192', 443, 0, 2550471192)> Signed-off-by: Christian Heimes <christian@python.org>