Commit Graph

39 Commits

Author SHA1 Message Date
Miss Islington (bot) 9bfa55bfea [2.7] bpo-31490: Fix an assertion failure in ctypes in case an _anonymous_ attr is defined only outside _fields_. (GH-3615) (#3780)
(cherry picked from commit 30b61b51e0)
2017-09-27 09:52:44 +03:00
Serhiy Storchaka 81691b0548 [2.7] bpo-31311: Fix a SystemError and a crash in ctypes._CData.__setstate__(), in case of a bad __dict__. (GH-3254). (#3781)
(cherry picked from commit 57c2561c8c)
2017-09-27 09:24:39 +03:00
Serhiy Storchaka d0b9dc3367 [2.7] bpo-30347: Stop crashes when concurrently iterate over itertools.groupby() iterators. (GH-1557). (#3772)
(cherry picked from commit c740e4fe8a)
2017-09-26 23:15:36 +03:00
Serhiy Storchaka d94a65a069 bpo-25732: Make functools.total_ordering implementing __ne__. (#3748)
Patch by Raymond Hettinger.
2017-09-25 14:41:34 +03:00
Igor Filatov cf7197ae43 [2.7] bpo-31351: Set return code in ensurepip when pip fails (GH-3734)
Previously ensurepip would always report success, even if the
pip installation failed.

(cherry picked from commit 9adda0cdf8)
2017-09-25 11:03:24 +10:00
Christian Heimes fd39e2a684 bpo-31474: Fix -Wint-in-bool-context warnings (#3581)
Signed-off-by: Christian Heimes <christian@python.org>
2017-09-15 20:27:23 +02:00
Serhiy Storchaka 004547f970 [2.7] bpo-31411: Prevent raising a SystemError in case warnings.onceregistry is not a dictionary. (GH-3485). (#3493)
(cherry picked from commit 252033d50e)
2017-09-11 10:01:31 +03:00
Cheryl Sabella e1847ea4a9 bpo-25684: ttk.OptionMenu radiobuttons weren't unique (GH-2276) (GH-2960)
ttk.OptionMenu radiobuttons weren't unique 
between instances of OptionMenu.
(cherry picked from commit a568e52733)
2017-09-09 23:02:14 -07:00
Christian Heimes b9a860f3bf [2.7] bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3 (GH-1363) (#3446)
* 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 cb5b68abde)
2017-09-07 22:31:17 -07:00
Christian Heimes 611a3eab19 [2.7] bpo-28958: Improve SSLContext error reporting. (GH-3414) (#3433)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 17c9ac9)
2017-09-07 16:45:07 -07:00
Miss Islington (bot) ab4894bba6 [2.7] bpo-21649: Add RFC 7525 and Mozilla server side TLS (GH-3387) (GH-3400)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit ad0ffa033e)
2017-09-06 17:31:48 -07:00
Benjamin Peterson eba0bad310 Merge branch 'release-2.7.14' into 2.7 2017-09-05 18:06:20 -07:00
Victor Stinner c00d5087cd bpo-31170: Update libexpat from 2.2.3 to 2.2.4 (#3315)
Fix copying of partial characters for UTF-8 input (libexpat bug 115):
https://github.com/libexpat/libexpat/issues/115

(cherry picked from commit 759e30ec47)

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
2017-09-05 18:04:39 -07:00
Victor Stinner eeadf5fc23 bpo-31339: Rewrite time.asctime() and time.ctime() (#3293)
* 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()
2017-09-06 01:35:39 +02:00
Gregory P. Smith 5e8e371364 bpo-27448: Work around a gc.disable race condition in subprocess. (#1932)
* bpo-27448: Work around a gc.disable race condition in subprocess.

This works around a gc.isenabled/gc.disable race condition in the 2.7
subprocess module by using a lock for the critical section.  It'll
prevent multiple simultaneous subprocess launches from winding up with
gc remaining disabled but it can't fix the ultimate problem: gc enable
and disable is a global setting and a hack.

Users are *strongly encouraged* to use subprocess32 from PyPI instead
of the 2.7 standard library subprocess module.  Mixing threads with
subprocess is a recipie for disaster otherwise even with "fixes" to
ameliorate common issues like this.

* Add a blurb!
2017-09-05 11:20:02 -07:00
Christian Heimes c9d668c0d8 [2.7] bpo-30502: Fix handling of long oids in ssl. (GH-2909). (#3322)
(cherry picked from commit e503ca5288)
2017-09-05 19:13:07 +02:00
Christian Heimes 7daa45db1d [2.7] bpo-30102: Call OPENSSL_add_all_algorithms_noconf (GH-3112) (#3343)
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)
2017-09-05 17:12:12 +02:00
Christian Heimes ffa7011cb9 [2.7] bpo-31343: Include sys/sysmacros.h (GH-3318) (#3345)
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 75b961869a)
2017-09-05 17:08:45 +02:00
Zachary Ware 986b7ffc65 [2.7] bpo-30450: Pull Windows dependencies from GitHub rather than SVN (GH-1783) (GH-3306)
The Windows build now depends on Python 3.6 to fetch externals, but it
will be downloaded via NuGet (which is downloaded via PowerShell) if it
is not available via `py -3.6`.  This means the only thing that must be
installed on a modern Windows box to do a full build of CPython with all
extensions is Visual Studio.

Cherry-picked from 51599e2bdd, parts of 40a23e8899, parts of 68d663cf85, d5cd21d75a, and possibly others that I've missed.

Also:

* Rename db -> bsddb for disambiguity

* Update sqlite3 to 3.14.2.0 since it's the version we use on 3.x, and it's simpler to just use it than to also upload the old version to cpython-source-deps

* Add PCbuild/*.ilk to .gitignore
2017-09-04 16:05:33 -07:00
Christian Heimes 57d963b0b5 [2.7] bpo-25674: remove sha256.tbs-internet.com ssl test (GH-3297) (#3301)
* bpo-25674: remove sha256.tbs-internet.com ssl test (#3297)

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 002d64039b)

* [2.7] bpo-25674: remove sha256.tbs-internet.com ssl test (GH-3297)

Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 002d64039b)
2017-09-04 23:08:36 +02:00
larryhastings 05308c73d7 Blurbify 2.7. (#3286) 2017-09-04 11:28:25 -07:00
INADA Naoki 4cde4bdcc8 bpo-31095: Fix potential crash during GC (GH-3197)
(cherry picked from commit a6296d34a4)
2017-09-04 12:31:41 +09:00
Pauli Virtanen 990b2d043c [2.7] bpo-10746: Fix ctypes PEP 3118 type codes for c_long, c_bool, c_int (GH-31) (#3242)
[2.7] bpo-10746: Fix ctypes PEP 3118 type codes for c_long, c_bool, c_int (GH-31)

Ctypes currently produces wrong pep3118 type codes for several types.
E.g. memoryview(ctypes.c_long()).format gives "<l" on 64-bit platforms,
but it should be "<q" instead for sizeof(c_long) == 8

The problem is that the '<>' endian specification in the struct syntax
also turns on the "standard size" mode, which makes type characters have
a platform-independent meaning, which does not match with the codes used
internally in ctypes.  The struct module format syntax also does not
allow specifying native-size non-native-endian items.

This commit adds a converter function that maps the internal ctypes
codes to appropriate struct module standard-size codes in the pep3118
format strings. The tests are modified to check for this..
(cherry picked from commit 07f1658aa0)
2017-09-02 18:24:32 +02:00
Oren Milman 20958e6d91 [2.7] bpo-31243: Fixed PyArg_ParseTuple failure checks. (GH-3171) (#3235) 2017-08-29 19:16:12 +03:00
Benjamin Peterson a944079d39 coalesce blurbs for 2.7.14rc1 2017-08-26 11:13:23 -07:00
Victor Stinner ec4ab09b7c bpo-30947: Update libexpat from 2.2.1 to 2.2.3 (#3106) (#3145)
* bpo-30947: Update libexpat from 2.2.1 to 2.2.3

* Add NEWS entry

* Add new loadlibrary.c

* expat_external.h: restore include "pyexpatns.h"

* PCbuild: add expat/loadlibrary.c

* Define XML_POOR_ENTROPY to compile expat

Python 2.7 backport: add expat/loadlibrary.c to PC/VS9.0/ project
files (_elementtree and pyexpat).

(cherry picked from commit 93d0cb58b4)
2017-08-19 01:06:45 +02:00
Christian Heimes 05b7d9c667 [2.7] bpo-30714: ALPN changes for OpenSSL 1.1.0f (#3094)
OpenSSL 1.1.0 to 1.1.0e aborted the handshake when server and client
could not agree on a protocol using ALPN. OpenSSL 1.1.0f changed that.
The most recent version now behaves like OpenSSL 1.0.2 again. The ALPN
callback can pretend to not been set.

See https://github.com/openssl/openssl/pull/3158 for more details

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit a5c1bab352)
2017-08-15 10:55:03 +02:00
Victor Stinner 56e162ad5c ttk: fix LabeledScale and OptionMenu destroy() method (#3026)
bpo-31135: Call the parent destroy() method even if the used
attribute doesn't exist.

The LabeledScale.destroy() method now also explicitly clears label
and scale attributes to help the garbage collector to destroy all
widgets.
2017-08-08 19:15:52 +02:00
Shane Harvey 88ffff5ddb [2.7] bpo-31107: Fix copyreg mangled slot names calculation. (GH-2989). (#3004)
(cherry picked from commit c4c9866064)
2017-08-05 18:03:01 +03:00
Serhiy Storchaka 3dd1ccbb09 bpo-29902: Emit a Py3k deprecation warning when pickling or copying (#2823)
some builtin and extension objects that don't support pickling
explicitly and are pickled incorrectly by default (like memoryview or
staticmethod).
2017-08-02 11:33:33 +03:00
INADA Naoki 3e37f4a115 bpo-29519: weakref spewing exceptions during interp finalization (#2958)
(cherry pick from 9cd7e17640)
2017-07-31 10:52:46 -07:00
Victor Stinner ec9a7127b8 [3.6] bpo-30595: Fix multiprocessing.Queue.get(timeout) (#2027) (#2881) (#2883)
* bpo-30595: Fix multiprocessing.Queue.get(timeout) (#2027)

multiprocessing.Queue.get() with a timeout now polls its reader in
non-blocking mode if it succeeded to aquire the lock but the acquire
took longer than the timeout.

Co-Authored-By: Grzegorz Grzywacz <grzgrzgrz3@gmail.com>
(cherry picked from commit 1b7863c3b6)

* bpo-30595: Increase test_queue_feeder_donot_stop_onexc() timeout (#2148)

_test_multiprocessing.test_queue_feeder_donot_stop_onexc() now uses a
timeout of 1 second on Queue.get(), instead of 0.1 second, for slow
buildbots.
(cherry picked from commit 8f6eeaf21c)

(cherry picked from commit e42339d3a0)
2017-07-26 17:52:36 +02:00
Dong-hee Na e5eae474c4 [2.7] bpo-30119: fix ftplib.FTP.putline() to throw an error for a illegal command (#1214) (#2894) 2017-07-26 17:50:36 +02:00
Victor Stinner 80ebc438ed bpo-30822: regrtest: fix -u extralargefile (#2788)
Fix also regrtest command line parser to allow passing -u
extralargefile to run test_zipfile64.
2017-07-21 02:12:14 +02:00
Nir Soffer bfa4fe4f39 [2.7] bpo-29854: Fix segfault in call_readline() (GH-728)
If history-length is set in .inputrc, and the history file is double the
history size (or more), history_get(N) returns NULL, and python
segfaults. Fix that by checking for NULL return value.

It seems that the root cause is incorrect handling of bigger history in
readline, but Python should not segfault even if readline returns
unexpected value.

This issue affects only GNU readline. When using libedit emulation
system history size option does not work.

This is a backport of the actual fix from master without the test, since
the test depends on new run_pty() helper which is not available in 2.7.
2017-07-11 00:06:57 +03:00
Antoine Pitrou a45a99b47f [2.7] bpo-30807: signal.setitimer() may disable the timer by mistake (GH-2493) (#2499)
* bpo-30807: signal.setitimer() may disable the timer by mistake

* Add NEWS blurb.
(cherry picked from commit 729780a810)
2017-06-30 10:54:54 +02:00
Victor Stinner 305f333a44 bpo-30283: Add NEWS entry for backported regrtest (#2398) 2017-06-27 08:42:01 +02:00
Antoine Pitrou 828488393c [2.7] bpo-30765: Avoid blocking when PyThread_acquire_lock() is asked not to (GH-2403) (#2420)
* [2.7] bpo-30765: Avoid blocking when PyThread_acquire_lock() is asked not to (GH-2403)

* bpo-30765: Avoid blocking when PyThread_acquire_lock() is asked not to lock

This is especially important if PyThread_acquire_lock() is called reentrantly
(for example from a signal handler).

* Update 2017-06-26-14-29-50.bpo-30765.Q5iBmf.rst

* Avoid core logic when taking the mutex failed.
(cherry picked from commit f84ac420c2)

* Remove test undef
2017-06-26 22:13:39 +02:00
larryhastings 1ecfa45195 Add "Misc/NEWS.d" directory tree for "blurb". (#2333)
CPython workflow is changing!  We're going to start using "blurb"
to manage Misc/NEWS entries:
    https://github.com/python/core-workflow
(This will be a big win for release managers, honest.)

This checkin simply populates the "Misc/NEWS.d" subdirectory tree
so that people can start putting their news entries in there.
No other changes (yet).
2017-06-22 16:00:05 -07:00