summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [2.7] Fix error message in sqlite connection thread check. (GH-6028). (GH-6325)Serhiy Storchaka2018-03-311-2/+2
| | | | | (cherry picked from commit 030345c0bfc2f76684666fe5c61e766ba5debfe6) Co-authored-by: Takuya Akiba <469803+iwiwi@users.noreply.github.com>
* bpo-31544: Fix a reference leak to 'self' after the previous target error ↵scoder2018-03-311-6/+21
| | | | | | handling fixes. (GH-6318) This change generally splits the xmlparser creation code into an unsafe part with "rollback" error handling and a safe "object initialisation done" part with normal decref cleanup.
* [2.7] bpo-33127: Compatibility patch for LibreSSL 2.7.0 (GH-6210) (GH-6215)Christian Heimes2018-03-241-8/+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-31544: Avoid calling "PyObject_GetAttrString()" (and potentially ↵scoder2018-03-241-2/+33
| | | | executing user code) with a live exception set. (GH-3992)
* 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>
* [2.7] bpo-32903: Fix a memory leak in os.chdir() on Windows (GH-5801). (#5947)Alexey Izbyshev2018-03-011-7/+8
| | | | | | (cherry picked from commit 3e197c7a6740d564ad52fb7901c07d5ff49460f5) Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
* [2.7] bpo-30622: Fix NPN for OpenSSL 1.1.1-pre1 (GH-5876) (#5882)Christian Heimes2018-02-251-21/+26
| | | | | | Signed-off-by: Christian Heimes <christian@python.org>. (cherry picked from commit 29eab55309b9f78b79074d26db16a44e7841c639) Co-authored-by: Christian Heimes <christian@python.org>
* Fix ssl module, Python 2.7 doesn't have Py_MAX (#5878)Christian Heimes2018-02-251-1/+2
| | | Signed-off-by: Christian Heimes <christian@python.org>
* [2.7] bpo-30622: Improve NPN support detection (GH-5859) (#5863)Christian Heimes2018-02-251-7/+20
| | | | | | | | | 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>
* [2.7] bpo-32185: Don't send IP in SNI TLS extension (GH-5865) (#5871)Miss Islington (bot)2018-02-251-2/+40
| | | | | | | | | The SSL module no longer sends IP addresses in SNI TLS extension on platforms with OpenSSL 1.0.2+ or inet_pton. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit e9370a47389903bb72badc95032ec84a0ebbf8cc) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-25404: SSLContext.load_dh_params() non-ASCII path (GH-3459)Christian Heimes2018-02-251-4/+17
| | | | | SSLContext.load_dh_params() now supports non-ASCII path. Signed-off-by: Christian Heimes <christian@python.org>
* 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-32539: Fix OSError for os.listdir() for extended-length paths on Windows ↵Anthony Sottile2018-01-151-1/+1
| | | | | | | (#5169) See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx?f=255&MSPPError=-2147217396#maxpath Paths that begin with `\\?\` are "extended-length paths".
* correct the typos (GH-4950) (#4952)Miss Islington (bot)2017-12-211-2/+2
| | | (cherry picked from commit 83cb778b4a3f856f2243b0f0d36fefb5c44b388f)
* [2.7] bpo-32186: Release the GIL during fstat and lseek calls (#4651)Nir Soffer2017-12-071-11/+44
| | | | | | | | In fileio, there were 3 fstat() calls and one lseek() call that did not release the GIL during the call. This can cause all threads to hang for unlimited time when using io.FileIO with inaccessible NFS server. Same issue seen in fileio exists also in fileobject, fixed in the same way.
* [2.7] bpo-31927: Fix reading arbitrary data when parse a AF_BLUETOOTH ↵Serhiy Storchaka2017-11-091-42/+42
| | | | | | | address (GH-4235) (GH-4352) (#4355) on NetBSD and DragonFly BSD. (cherry picked from commit d3187158c09cf899e9849f335bdff10594209167). (cherry picked from commit 596286f8f3c8e53ef010d6298464775dc900a515)
* bpo-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor ↵Oren Milman2017-11-081-0/+5
| | | | object is uninitialized (GH-4333)
* Fix bpo-27666 backporting error in _cursesmodule.c (#4305)Serhiy Storchaka2017-11-071-2/+2
|
* bpo-31770: Prevent a crash and refleaks when calling ↵Miss Islington (bot)2017-11-071-8/+7
| | | | | sqlite3.Cursor.__init__() more than once (GH-3968) (#4302) (cherry picked from commit e56ab746a965277ffcc4396d8a0902b6e072d049)
* [2.7] bpo-30057: Fix potential missed signal in signal.signal(). (GH-4258) ↵Antoine Pitrou2017-11-031-1/+4
| | | | | | (#4263) Bug report and patch by Jeroen Demeyer.. (cherry picked from commit f6f90ff079a22b79a58d47b6117cc8a8c7d366f3)
* bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse(). ↵Miss Islington (bot)2017-11-011-12/+26
| | | | | (GH-4220) (#4222) (cherry picked from commit 4f469c096628af730b17798d0ebfd8925bfde836)
* bpo-31893: Fix a backporting error in ↵Serhiy Storchaka2017-11-011-3/+6
| | | | 8cbf4e10646c3f5b8f0d274c2d7dea5bb6305f57. (#4219)
* bpo-31919: Fix building the curses module on OpenIndiana. (GH-4211) (#4216)Miss Islington (bot)2017-11-011-2/+4
| | | (cherry picked from commit 894ebd065e02debf20c0657d26020ecc42b7534f)
* bpo-25720: Fix the method for checking pad state of curses WINDOW (GH-4164) ↵Miss Islington (bot)2017-11-011-8/+16
| | | | | | | | | | | (#4213) Modify the code to use ncurses is_pad() instead of checking WINDOW _flags field. If your platform does not provide the is_pad(), the existing way that checks the field will be enabled. Note: This change does not drop support for platforms where do not have both WINDOW _flags field and is_pad(). (cherry picked from commit 8bc7d63560024681dce9f40445f2877b2987e92c)
* bpo-31893: Fix errors in b9052a0f91d2e83bbc27267247a5920c82b242a3. (GH-4196) ↵Miss Islington (bot)2017-10-311-4/+4
| | | | | | | (#4202) * Fix a compilation error on FreeBSD. * Fix the data attribute size on Mac OS X. (cherry picked from commit 2298fad5ff907dd48ea0fb5c71fa22334ef28c6b)
* [2.7] bpo-31893: Fixed select.kqueue(). (GH-4166) (#4193)Serhiy Storchaka2017-10-311-48/+84
| | | | | * Fixed the layout of the kqueue_event structure on OpenBSD and NetBSD. * Fixed the comparison of the kqueue_event objects.. (cherry picked from commit b9052a0f91d2e83bbc27267247a5920c82b242a3)
* [2.7] bpo-31891: Fix building the curses module on NetBSD. (GH-4165). (#4194)Serhiy Storchaka2017-10-311-33/+40
| | | (cherry picked from commit baac01e629d90f63dfde6b5cc433f4bc65c5feeb)
* [2.7] bpo-31752: Fix possible crash in timedelta constructor called with ↵Serhiy Storchaka2017-10-231-2/+7
| | | | | | custom integers. (GH-3947) (#4088) Bad remainder in divmod() in intermediate calculations caused an assertion failure.. (cherry picked from commit 4ffd4653a7ec9c97775472276cf5e159e2366bb2)
* [2.7] bpo-31334: Fix timeout in select.poll.poll() (GH-3277) (#4034)Riccardo Coccioli2017-10-181-0/+11
| | | | | | | Always pass -1, or INFTIM where defined, to the poll() system call when a negative timeout is passed to the poll.poll([timeout]) method in the select module. Various OSes throw an error with arbitrary negative values.. (cherry picked from commit 6cfa927ceb931ad968b5b03e4a2bffb64a8a0604)
* [2.7] bpo-30058: Fixed buffer overflow in select.kqueue.control(). ↵Serhiy Storchaka2017-10-121-16/+13
| | | | | (GH-1095). (#3976) (cherry picked from commit de072100775cc29e6cd93a75466cecbd1086f258)
* [2.7] bpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ ↵Oren Milman2017-10-121-3/+3
| | | | attr is defined only outside _fields_. (GH-3615) (#3952)
* [2.7] bpo-31728: Prevent crashes in _elementtree due to unsafe cleanup of ↵Oren Milman2017-10-111-20/+21
| | | | Element.text and Element.tail (GH-3924) (#3950)
* bpo-31719: Fix test_regrtest.test_crashed() on s390x (#3912)Victor Stinner2017-10-091-0/+17
| | | | | | | Add a new _testcapi._read_null() function to crash Python in a reliable way on s390x. On s390x, ctypes.string_at(0) returns an empty string rather than crashing.
* [2.7] bpo-31675: Fix memory leaks in Tkinter's methods splitlist() and ↵2.7Serhiy Storchaka2017-10-041-2/+10
| | | | | | | | split() (GH-3866) (#3876) when pass a string larger than 2 GiB. Decrease memory requirements for Tcl's bigmem tests.. (cherry picked from commit 27c623c845dd6e4b8e1782666ca3a956636da266)
* [2.7] bpo-31478: Prevent unwanted behavior in _random.Random.seed() in case ↵Oren Milman2017-10-021-2/+8
| | | | the arg has a bad __abs__() method (GH-3596) (#3845)
* bpo-28129: fix ctypes crashes (#386) (#3800)Victor Stinner2017-09-282-9/+34
| | | | | | | | | | | | | * init commit, with initial tests for from_param and fields __set__ and __get__, and some additions to from_buffer and from_buffer_copy * added the rest of tests and patches. probably only a first draft. * removed trailing spaces * replace ctype with ctypes in error messages * change back from ctypes instance to ctype instance (cherry picked from commit 1bea762d9ec823544c530d567330a47f64d93d4f)
* [2.7] bpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ ↵Miss Islington (bot)2017-09-271-1/+9
| | | | | | attr is defined only outside _fields_. (GH-3615) (#3780) (cherry picked from commit 30b61b51e05d2d43e8e2e783b0a9df738535423b)
* [2.7] bpo-31311: Fix a SystemError and a crash in ↵Serhiy Storchaka2017-09-271-0/+10
| | | | | ctypes._CData.__setstate__(), in case of a bad __dict__. (GH-3254). (#3781) (cherry picked from commit 57c2561c8c5663aef55b00e3f29cba575ff36ccd)
* [2.7] bpo-25359: Add missed "goto error" after setting an exception. ↵Serhiy Storchaka2017-09-271-0/+1
| | | | | (GH-3712) (#3779) (cherry picked from commit d6238a76c655e0feb13478505220dc9049f1682f)
* [2.7] bpo-30347: Stop crashes when concurrently iterate over ↵Serhiy Storchaka2017-09-261-46/+32
| | | | | itertools.groupby() iterators. (GH-1557). (#3772) (cherry picked from commit c740e4fe8a9bc5815dc18c38d7f7600b128c3c51)
* consistently use Py_TYPE, Py_REFCNT, and correct initializer macros (#3563)Benjamin Peterson2017-09-1410-35/+27
| | | This no-op change makes 2.7 more consistent with 3.x to ease comparison and backports.
* [2.7] bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3 (GH-1363) (#3446)Christian Heimes2017-09-081-0/+13
| | | | | | | | | | | | | | | | * bpo-29136: Add TLS 1.3 support TLS 1.3 introduces a new, distinct set of cipher suites. The TLS 1.3 cipher suites don't overlap with cipher suites from TLS 1.2 and earlier. Since Python sets its own set of permitted ciphers, TLS 1.3 handshake will fail as soon as OpenSSL 1.1.1 is released. Let's enable the common AES-GCM and ChaCha20 suites. Additionally the flag OP_NO_TLSv1_3 is added. It defaults to 0 (no op) with OpenSSL prior to 1.1.1. This allows applications to opt-out from TLS 1.3 now. Signed-off-by: Christian Heimes <christian@python.org>. (cherry picked from commit cb5b68abdeb1b1d56c581d5b4d647018703d61e3)
* [2.7] bpo-28958: Improve SSLContext error reporting. (GH-3414) (#3433)Christian Heimes2017-09-071-2/+1
| | | | Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 17c9ac9)
* Merge branch 'release-2.7.14' into 2.7Benjamin Peterson2017-09-0619-58/+581
|\
| * bpo-31170: Update libexpat from 2.2.3 to 2.2.4 (#3315)Victor Stinner2017-09-0619-58/+581
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix copying of partial characters for UTF-8 input (libexpat bug 115): https://github.com/libexpat/libexpat/issues/115 (cherry picked from commit 759e30ec47048cb9835c62aaeac48748c8151390) The standard header stdbool.h is not available with old Visual Studio compilers Cherry-picked from libexpat b4b89c2ab0cc5325a41360c25ef9d2ccbe617e5c. expat: Add artificial scopes in xmltok.c utf8_toUtf8() to fix c89 compilation. Cherry-picked from libexpat commit e0b290eb3d8f4c4b45137a7d7f4f8db812145bd2
* | bpo-31339: Rewrite time.asctime() and time.ctime() (#3293)Victor Stinner2017-09-051-18/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-31339: Rewrite time.asctime() and time.ctime() Backport and adapt the _asctime() function from the master branch to not depend on the implementation of asctime() and ctime() from the external C library. This change fixes a bug when Python is run using the musl C library. * bound checks for time.asctime() * bound checks for time.strftime()
* | [2.7] bpo-30502: Fix handling of long oids in ssl. (GH-2909). (#3322)Christian Heimes2017-09-051-41/+48
| | | | | | (cherry picked from commit e503ca52889bf66ac502702569e726caa7970299)
* | [2.7] bpo-30102: Call OPENSSL_add_all_algorithms_noconf (GH-3112) (#3343)Christian Heimes2017-09-052-2/+9
| | | | | | | | | | | | | | | | | | The ssl and hashlib modules now call OPENSSL_add_all_algorithms_noconf() on OpenSSL < 1.1.0. The function detects CPU features and enables optimizations on some CPU architectures such as POWER8. Patch is based on research from Gustavo Serra Scalet. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit c941e62)
* | [2.7] bpo-31343: Include sys/sysmacros.h (GH-3318) (#3345)Christian Heimes2017-09-051-0/+5
| | | | | | | | | | | | | | Include sys/sysmacros.h for major(), minor(), and makedev(). GNU C libray plans to remove the functions from sys/types.h. Signed-off-by: Christian Heimes <christian@python.org>. (cherry picked from commit 75b961869a1184895c9d5bf41a57f3c985622662)
* | [2.7] bpo-30622: Change NPN detection: (GH-2079) (#3316)Christian Heimes2017-09-041-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Change NPN detection: Version breakdown, support disabled (pre-patch/post-patch): - pre-1.0.1: OPENSSL_NPN_NEGOTIATED will not be defined -> False/False - 1.0.1 and 1.0.2: OPENSSL_NPN_NEGOTIATED will not be defined -> False/False - 1.1.0+: OPENSSL_NPN_NEGOTIATED will be defined and OPENSSL_NO_NEXTPROTONEG will be defined -> True/False Version breakdown support enabled (pre-patch/post-patch): - pre-1.0.1: OPENSSL_NPN_NEGOTIATED will not be defined -> False/False - 1.0.1 and 1.0.2: OPENSSL_NPN_NEGOTIATED will be defined and OPENSSL_NO_NEXTPROTONEG will not be defined -> True/True - 1.1.0+: OPENSSL_NPN_NEGOTIATED will be defined and OPENSSL_NO_NEXTPROTONEG will not be defined -> True/True * Refine NPN guard: - If NPN is disabled, but ALPN is available we need our callback - Make clinic's ssl behave the same way This created a working ssl module for me, with NPN disabled and ALPN enabled for OpenSSL 1.1.0f. Concerns to address: The initial commit for NPN support into OpenSSL [1], had the OPENSSL_NPN_* variables defined inside the OPENSSL_NO_NEXTPROTONEG guard. The question is if that ever made it into a release. This would need an ugly hack, something like: GH-if defined(OPENSSL_NO_NEXTPROTONEG) && \ !defined(OPENSSL_NPN_NEGOTIATED) GH- define OPENSSL_NPN_UNSUPPORTED 0 GH- define OPENSSL_NPN_NEGOTIATED 1 GH- define OPENSSL_NPN_NO_OVERLAP 2 GH-endif [1] https://github.com/openssl/openssl/commit/68b33cc5c7. (cherry picked from commit b2d096bd2a5ff86e53c25d00ee5fa097b36bf1d8)