Commit Graph

80367 Commits

Author SHA1 Message Date
Miss Islington (bot) 82cae7c5be [2.7] bpo-31330: Clarify that RawTextHelpFormatter collapses repeated newlines. (GH-3272) (GH-3428)
Also provide a solution if the user wants to keep multiple blank lines.
(cherry picked from commit 397c467c49)
2017-09-07 17:17:42 -04:00
Hanno Schlichting abea972d28 [2.7] bpo-29766: Fix configure/.ac to match LTO/enable-optimizations behavior. (#2705)
See also 1f29cefc87.  The configure.ac change was omitted from the earlier change...
2017-09-07 11:43:45 -07:00
Christian Heimes 8092719e93 [2.7] Update multissl test helper (GH-3349) (#3416)
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit d3b9f97e6d)
2017-09-07 10:12:22 -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
Miss Islington (bot) 47e5f79122 [2.7] bpo-30824: Add mimetype for .json (GH-3048) (#3394)
(cherry picked from commit 8204b90368)
2017-09-06 18:31:36 -04:00
Victor Stinner 2bc83afb30 bpo-31355: Travis CI: remove the macOS job (#3367) 2017-09-05 18:44:40 -07:00
Benjamin Peterson 6d6ff08d38 [2.7] Issue GH-28705: greatly simplify the FAQ entry on transpiling. (#3371)
This also eliminats a dead link to Weave in the process..
(cherry picked from commit 78ffd6cffa)
2017-09-05 18:18:16 -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
Zachary Ware fef3ddbbcc [2.7] Cache externals, depending on changes to PCbuild (GH-3308) (#3365)
(cherry picked from commit f801322e92)
2017-09-05 18:01:49 -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
Zachary Ware 8905fb831c bpo-30450: Don't use where, XP doesn't have it (GH-3348)
Really this time!
2017-09-05 13:02:03 -07: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 9721e51daf [2.7] Travis: use ccache (GH-3307) (#3333)
(cherry picked from commit 8adc73c)
2017-09-05 19:14:03 +02: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
Zachary Ware aa23144d15 Don't use `where`, it doesn't exist on XP (GH-3330) 2017-09-05 09:34:54 -07: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
Christian Heimes 72ed233167 [2.7] bpo-30622: Change NPN detection: (GH-2079) (#3316)
* 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 b2d096bd2a)
2017-09-05 01:11:40 +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
Steve Dower 0b69b3723d Enables RC markings in nuget packages. (#3216) 2017-08-26 18:00:48 -07:00
Benjamin Peterson 5bd2368840 Merge branch 'release-2.7.14' into 2.7 2017-08-26 13:42:29 -07:00
Oren Milman bc80fd1bd2 [2.7] bpo-28261: Prevent raising SystemError where PyArg_ParseTuple is used to parse non-args. (#3213) 2017-08-26 21:56:31 +03:00
Benjamin Peterson c707893f9c version bumps for 2.7.14rc1 2017-08-26 11:18:30 -07:00
Benjamin Peterson 48455e2151 update pydoc topics 2017-08-26 11:17:02 -07:00
Benjamin Peterson a944079d39 coalesce blurbs for 2.7.14rc1 2017-08-26 11:13:23 -07:00
Victor Stinner 02e03672e6 bpo-31258: test_urllib2_localnet uses addCleanup(server.stop) (#3184)
Use self.addCleanup(self.server.stop) to stop the HTTP server. Some
tests didn't stop the server like test_https().
2017-08-22 16:51:20 +02:00
Victor Stinner 1460ce5a93 bpo-31258: test_signal: call waitpid() to prevent zombie process (#3183) 2017-08-22 16:51:09 +02:00
Victor Stinner cce1cb9180 bpo-30871: Add test.pythoninfo (#3174) (#3175)
* bpo-30871: Add test.pythoninfo (#3075)

* Add Lib/test/pythoninfo.py: script collecting various informations
  about Python to help debugging test failures.
* regrtest: remove sys.hash_info and sys.flags from header.
* Travis CI, Appveyor: run pythoninfo before tests
(cherry picked from commit b907abc885)

* bpo-30871: pythoninfo: add expat and _decimal (#3121)

* bpo-30871: pythoninfo: add expat and _decimal

* Remove _decimal.__version__

The string is hardcoded, not really interesting.

(cherry picked from commit f6ebd838f0)

* bpo-30871: Add "make pythoninfo" (#3120)

(cherry picked from commit a3a01a2fce)

* bpo-30871: pythoninfo: more sys, os, time data (#3130)

* bpo-30871: pythoninfo: more sys, os, time data

PythonInfo now converts types other than intger to string by default.

* fix typo

(cherry picked from commit ad7eaed543)

* bpo-31231: Fix pythoninfo in Travis config (#3134)

bpo-31231, bpo-30871: Replace "./python -m test.pythoninfo" with
"make pythoninfo", since macOS uses ./python.exe.
(cherry picked from commit 92b1f90143)

(cherry picked from commit 29d007bb67)
2017-08-22 03:40:26 +02:00
Victor Stinner 0fbac706f7 regrtest: fix test to choose if header should be displayed (#3172)
Check "tests" before its value is replaced.
2017-08-21 23:57:06 +02:00
Victor Stinner 02d4292df4 bpo-30263: regrtest: add system load average (#3165)
Add the CPU count in the header.
2017-08-21 18:01:11 +02: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
Victor Stinner 5e006aa05f gitignore: add more rules from master for Windows (#3148) 2017-08-19 00:50:15 +02:00
Mariatta 2281c041b2 Fix broken `Show Source` links on documentation pages (GH-3113) (GH-3128)
The `Show Source` was broken because of a change made in sphinx 1.5.1
In Sphinx 1.4.9, the sourcename was "index.txt".
In Sphinx 1.5.1+, it is now "index.rst.txt".

(cherry picked from commit b9ff498793)
2017-08-18 06:22:32 -07:00
Victor Stinner d45cb040b9 [2.7] bpo-31221: patchcheck ignores external libraries (#3109) (#3118)
* bpo-31221: patchcheck ignores external libraries (#3109)

Tools/scripts/patchcheck.py now ignores changes in directories which
are copies of external libraries:

* Modules/_ctypes/libffi_msvc/
* Modules/_ctypes/libffi_osx/
* Modules/_decimal/libmpdec/
* Modules/expat/
* Modules/zlib/

Drop also support for Mercurial, since CPython migrated to Git.

Exclude also libmpdec

patchcheck: exclude also libffi_osx and libffi_msvc
(cherry picked from commit 4a347ce426)

* Exclude also Modules/_ctypes/libffi on Python 2.7

* Remove _decimal/libmpdec, not in Python 2.7
2017-08-17 17:13:01 +02:00
Julien Palard 3cc46bb3ed Update the language selection in the docs language switch. (GH-3114) (#3117)
Change the option for `Français` into `French` to be consistent with the other language selections that are already in English.
(cherry picked from commit b616b97299)
2017-08-17 16:37:56 +02:00
Victor Stinner 883520a846 bpo-31069, test_multiprocessing: Fix dangling process (#3103) (#3105)
Fix a warning about dangling processes in test_rapid_restart() of
_test_multiprocessing: join the process.
(cherry picked from commit 17657bb945)
2017-08-16 13:14:40 +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
Julien Palard fe8d9dc479 bpo-31159: fix language switch regex on unknown yet built languages. … (#3051) (#3081)
* bpo-31159: fix language switch regex on unknown yet built languages. (#3039)

This fix a regex issue (a missing non-matching group around an 'or'
list) and the specific possible case where a translation is built but
not yet in known by the picker, but not explicitly listing possible
languages in the regex.
(cherry picked from commit 122081deef)

* bpo-31149: Doc: Add Japanese to the language switcher. (#3028)

(cherry picked from commit c82b7f332a)

(cherry picked from commit e8e7fba0b2)
2017-08-13 23:44:51 +02:00
Victor Stinner 504939fdf4 bpo-31067: test_subprocess calls reap_children() (#2931) (#3073)
test_subprocess now also calls reap_children() in tearDown(), not
only on setUp().
(cherry picked from commit cc42c121eb)
2017-08-11 17:14:31 +02:00
Victor Stinner 4dea06531e bpo-31173: Rewrite WSTOPSIG test of test_subprocess (#3055) (#3071)
The current test_child_terminated_in_stopped_state() function test
creates a child process which calls ptrace(PTRACE_TRACEME, 0, 0) and
then crash (SIGSEGV). The problem is that calling os.waitpid() in the
parent process is not enough to close the process: the child process
remains alive and so the unit test leaks a child process in a
strange state. Closing the child process requires non-trivial code,
maybe platform specific.

Remove the functional test and replaces it with an unit test which
mocks os.waitpid() using a new _testcapi.W_STOPCODE() function to
test the WIFSTOPPED() path.
(cherry picked from commit 7b7c6dcfff)
2017-08-11 14:38:37 +02:00
Victor Stinner 1247e2cda5 [2.7] bpo-31160: Backport reap_children fixes from master to 2.7 (#3063)
* bpo-31160: regrtest now reaps child processes (#3044)

Add a post_test_cleanup() function which currently only calls
support.reap_children().
(cherry picked from commit e3510d74aa)

* bpo-31160: test_tempfile: Fix reap_children() warning (#3056)

TestRandomNameSequence.test_process_awareness() now calls
os.waitpid() to avoid leaking a zombie process.
(cherry picked from commit 6c8c2943d9)
2017-08-10 16:45:38 +02:00
Victor Stinner 693790817a PCbuild: downgrade pcbuild.sln to support VS 2010 (#3031)
bpo-31133: Downgrade PCbuild/pcbuild.sln from format version 12.00 to
11.00 to support Visual Studio 2010 and newer, not only VS 2013 and
newer.
2017-08-10 16:11:29 +02:00
Ammar Askar 425680bbd2 [2.7] bpo-31150: Wait for child process in test_forkinthread to avoid thread reaped warnings (#3042) 2017-08-09 16:54:53 +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