Commit Graph

98408 Commits

Author SHA1 Message Date
Miss Islington (bot) 1fc47b40af [3.6] bpo-21649: Add RFC 7525 and Mozilla server side TLS (GH-3387) (GH-3399)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit ad0ffa033e)
2017-09-06 17:31:30 -07:00
Miss Islington (bot) e29ab7e751 [3.6] bpo-30824: Add mimetype for .json (GH-3048) (#3401)
(cherry picked from commit 8204b90368)
2017-09-06 20:04:14 -04:00
Steve Dower fd645ec6f5 [3.6] bpo-31340: Change to building with MSVC v141 (included with Visual Studio 2017) (GH-3311) (#3386) 2017-09-06 15:55:25 -07:00
Miss Islington (bot) 34c67614c1 [3.6] Fixes Tix build by correcting the directories used by Tcl and Tk. (GH-3391) (#3392) 2017-09-06 15:00:26 -07:00
Miss Islington (bot) 98ceece8f4 [3.6] bpo-30737: Update DevGuide links to new URL (GH-3228) (GH-3390)
Update old devguide links from https://docs.python.org/devguide to https://devguide.python.org
(cherry picked from commit 384899dfae)
2017-09-06 14:29:04 -07:00
Gregory P. Smith 3bad1650a0 [3.6] bpo-31178: Avoid concatenating bytes with str in subprocess error (GH-3066) (#3388)
Avoid concatenating bytes with str in the typically rare subprocess error path (exec failed). Includes a mock based unittest to exercise the codepath.
(cherry picked from commit 3fc499bca1)
2017-09-06 13:34:17 -07:00
Miss Islington (bot) 3aea3c298b [3.6] Stop test_xmlrpc from writing to sys.stderr (GH-3359) (#3380)
One test case of test_xmlrpc uses HTTPServer with a subclass of
BaseHTTPRequestHandler. The BaseRequestHandler class logs to
sys.stderr by default. Override log_message() to not clobber
test output.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 3463ee3972)
2017-09-06 10:22:14 -07:00
Christian Heimes 6da379bde3 [3.6] bpo-29781: Fix SSLObject.version before handshake (GH-3364) (#3381)
SSLObject.version() now correctly returns None when handshake over BIO has
not been performed yet.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 6877111)
2017-09-06 06:42:30 -07:00
Christian Heimes c3c3062169 [3.6] _pickle: Fix whichmodule() (GH-3358) (#3361)
_PyUnicode_FromId() can return NULL: replace Py_INCREF() with
Py_XINCREF().

Fix coverity report: CID 1417269.
(cherry picked from commit af46eb8)
2017-09-05 21:43:19 -07:00
Miss Islington (bot) ff125e1aa9 bpo-31350: Optimize get_event_loop and _get_running_loop (GH-3347) (GH-3373)
* call remove_done_callback in finally section

* Optimize get_event_loop and _get_running_loop

* rename _loop_pid as loop_pid and add blurb news

* rename _loop_pid as loop_pid and add blurb news

* add back _RunningLoop

* Update 2017-09-05-10-30-48.bpo-31350.dXJ-7N.rst

* Update 2017-09-05-10-30-48.bpo-31350.dXJ-7N.rst
(cherry picked from commit 80bbe6a7b6)
2017-09-05 20:05:35 -07:00
Victor Stinner 11453524ed bpo-31355: Travis CI: remove the macOS job (#3367) 2017-09-05 18:41:28 -07:00
Mariatta 3b9d4444fe [3.6] bpo-30662: fixed OrderedDict.__init__ docstring re PEP 468 (GH-2179) (GH-3370)
* fixed OrderedDict.__init__ docstring re PEP 468

* tightened comment and mirrored to C impl

* added space after period per marco-buttu

* preserved substituted for stable

* drop references to Python 3.6 and PEP 468
(cherry picked from commit faa57cbe70)
2017-09-05 18:13:07 -07:00
Miss Islington (bot) c506403faf [3.6] bpo-31320: No traceback to sys.stderr in test_ssl (GH-3360) (GH-3369)
In case PROTOCOL_TLS_SERVER is used for both client context and server
context, the test thread dies with OSError. Catch OSError to avoid
traceback on sys.stderr

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 305e56c27a)
2017-09-05 18:11:31 -07:00
Zachary Ware 56b56e3da0 [3.6] Cache externals, depending on changes to PCbuild (GH-3308) (#3366)
(cherry picked from commit f801322e92)
2017-09-05 18:01:33 -07:00
Benjamin Peterson 1b1329debc [3.6] link to legacy doc on the non-legacy website (GH-3362) (#3368)
(cherry picked from commit 60dbed1850)
2017-09-05 17:45:11 -07:00
Victor Stinner 9a3b3852af bpo-30442: Skips refcount test in test_xml_etree under coverage (#1767) (#3363)
(cherry picked from commit 1de4705d00)
2017-09-06 02:10:08 +02:00
Victor Stinner e5f2f80385 bpo-31170: Update libexpat from 2.2.3 to 2.2.4 (#3315) (#3350)
* bpo-31170: Update libexpat from 2.2.3 to 2.2.4

Fix copying of partial characters for UTF-8 input (libexpat bug 115):
https://github.com/libexpat/libexpat/issues/115

* Add NEWS entry.

(cherry picked from commit 759e30ec47)
2017-09-06 01:30:22 +02:00
Victor Stinner 6fce7ea893 bpo-30445: Allow appended output in RecursionError message (#3356)
Running under coverage sometimes causes 'in comparison' to be added to the end of the RecursionError message, which is acceptable.

Patched by Maria Mckinley

(cherry picked from commit 3480ef9dd3)
2017-09-06 01:07:44 +02:00
Christian Heimes 63b3f2b19c [3.6] bpo-29334: Fix ssl.getpeercert for auto-handshake (GH-1769) (#1778)
Drop handshake_done and peer_cert members from PySSLSocket struct. The
peer certificate can be acquired from *SSL directly.
SSL_get_peer_certificate() does not trigger any network activity.
Instead of manually tracking the handshake state, simply use
SSL_is_init_finished().

In combination these changes fix auto-handshake for non-blocking
MemoryBIO connections.

Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 66dc33b682)
2017-09-05 13:43:05 -07:00
Christian Heimes f201e886fc [3.6] bpo-30502: Fix handling of long oids in ssl. (GH-2909) (#3321)
(cherry picked from commit e503ca5288)
2017-09-05 19:13:03 +02:00
Christian Heimes 2ddea0f098 [3.6] bpo-30102: Call OPENSSL_add_all_algorithms_noconf (GH-3112) (#3342)
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:03 +02:00
Christian Heimes 02854dab62 [3.6] bpo-31343: Include sys/sysmacros.h (GH-3318) (#3344)
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 75b9618)
2017-09-05 17:09:12 +02:00
Christian Heimes 8704d5439c [3.6] Travis: use ccache (GH-3307) (#3332)
(cherry picked from commit 8adc73c)
2017-09-05 16:03:29 +02:00
Christian Heimes 7316c6d4a5 [3.6] bpo-30622: Change NPN detection: (GH-2079) (#3314)
* 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 b2d096b)
2017-09-05 16:00:44 +02:00
Ned Deily e2543a67fb Include additional changes to support blurbified NEWS (#3340) 2017-09-05 00:10:31 -07:00
Ned Deily 114c457408 Simplify NEWS entry to prevent suspicious warnings. (#3339) 2017-09-04 23:23:04 -07:00
larryhastings 254ee4d5ed Fix malformed handcrafted blurb filename. (#3327) 2017-09-04 22:27:31 -07:00
Gregory P. Smith 16a3a7b6a0 Rename my manually mis-named NEWS.d file. #sorry (#3326) 2017-09-04 16:38:23 -07:00
Gregory P. Smith d50ce4fcc9 [3.6] Added effect of re.ASCII and reworded slightly (GH-1782) (#3313)
(cherry picked from commit c9d6dbc290)
2017-09-04 14:58:31 -07:00
Gregory P. Smith 1dba3789e3 bpo-22536 [3.6] Set filename in FileNotFoundError (#3305)
* [3.6] bpo-22536: Set the filename in FileNotFoundError. (GH-3194)

Have the subprocess module set the filename in the FileNotFoundError
exception raised on POSIX systems when the executable or cwd are missing.
(cherry picked from commit 8621bb5d93)

* bpo-22536 [3.6] (GH-3202) skip non-windows tests.
2017-09-04 14:23:23 -07:00
Benjamin Peterson 703fdb837a [3.6] remote note about IRIX in aifc (#3304)
This comment hasn't been true since Python 3.0.
(cherry picked from commit b84efddb9a)
2017-09-04 13:58:23 -07:00
Christian Heimes 4bc8ef0eee [3.6] bpo-25674: remove sha256.tbs-internet.com ssl test (GH-3297) (#3300)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 002d64039b)
2017-09-04 22:54:47 +02:00
larryhastings 6a116c2aa4 Blurbify 3.6. (#3287)
Blurbify 3.6.
2017-09-04 12:03:25 -07:00
Segev Finer 39fde5f93b [3.6] Add missing _sha3 module to Setup.dist (GH-2395) (#3280)
(cherry picked from commit 1c1f8f30c0)
2017-09-04 10:08:35 -07:00
INADA Naoki 2eea952b1b bpo-31095: fix potential crash during GC (GH-3195)
(cherry picked from commit a6296d34a4)
2017-09-04 12:31:09 +09:00
Gregory P. Smith 7d8282d25d [3.6] bpo-29212: Fix the ugly repr() ThreadPoolExecutor thread name. (GH-2315) (#3276)
bpo-29212: Fix the ugly ThreadPoolExecutor thread name.

Fixes the newly introduced ugly default thread name for concurrent.futures
thread.ThreadPoolExecutor threads.  They'll now resemble the old <=3.5
threading default Thread-x names by being named ThreadPoolExecutor-y_n..
(cherry picked from commit a3d91b43c2)
2017-09-03 14:52:20 -07:00
Gregory P. Smith 31b8efeaa8 [3.6] bpo-9146: Raise a ValueError if OpenSSL fails to init a hash func (#3274)
* [3.6] bpo-9146: Raise a ValueError if OpenSSL fails to init a hash func. (GH-1777)

This helps people in weird FIPS mode environments where common things
like MD5 are not available in the binary as a matter of policy.
(cherry picked from commit 07244a8301)

* Include a NEWS entry.
2017-09-03 14:35:19 -07:00
Gregory P. Smith d4097353ba [3.6] Fix a typo in the Programming FAQ. (GH-3230) (#3273)
subobjects, not subobjecs.
(cherry picked from commit e9d978fd1b)
2017-09-03 13:29:34 -07:00
Antoine Pitrou 5cbca0235b [3.6] Fix a c.f.as_completed() refleak previously introduced in bpo-27144 (GH-3270) (#3271)
(cherry picked from commit 2ef3760)
2017-09-03 15:30:55 +02:00
Serhiy Storchaka 98bbeb78e0 bpo-31185: Fixed miscellaneous errors in asyncio speedup module. (#3076) (#3269)
(cherry picked from commit bca4939d80)
2017-09-03 09:24:32 +03:00
Christopher Wilcox 58521fdba1 bpo-30581: Windows: os.cpu_count() returns wrong number of processors (#2934) (#3267)
* Fixes #30581 by adding a path to use newer GetMaximumProcessorCount API on Windows calls to os.cpu_count()

* Add NEWS.d entry for bpo-30581, os.cpu_count on Windows.

* Tweak NEWS entry
2017-09-01 21:28:47 +02:00
Antoine Pitrou ea767915f7 [3.6] bpo-27144: concurrent.futures as_complete and map iterators do not keep reference to returned object (GH-1560) (#3266)
bpo-27144: concurrent.futures as_complie and map iterators do not keep
reference to returned object

(cherry picked from commit 97e1b1c814)
2017-09-01 19:16:46 +02:00
Victor Stinner 98c849a2f3 bpo-31217: Fix regrtest -R for small integer (#3260) (#3261)
Use a pool of integer objects toprevent false alarm when checking for
memory block leaks. Fill the pool with values in -1000..1000 which
are the most common (reference, memory block, file descriptor)
differences.

Co-Authored-By: Antoine Pitrou <pitrou@free.fr>
(cherry picked from commit 6c2feabc5d)
2017-09-01 15:04:47 +02:00
Victor Stinner 60f3f1fb5c bpo-31249: Fix ref cycle in ThreadPoolExecutor (#3253)
[3.6] bpo-31249: Fix ref cycle in ThreadPoolExecutor
2017-09-01 14:46:44 +02:00
Mariatta b5db7bb9da [3.6] Fix the indentation in Extending Python code example (GH-3244) (GH-3250)
Code was indented with three spaces.
Fixed using four spaces.
(cherry picked from commit d9a2b99ac4)
2017-08-30 23:11:02 -07:00
Oren Milman 095a421b16 [3.6] bpo-31291: Fixed an assertion failure in zipimport.zipimporter.get_data() (GH-3226) (#3243)
if pathname.replace('/', '\\') returns non-string.
(cherry picked from commit 631fdee6e6)
2017-08-30 14:08:39 +03:00
Pauli Virtanen 2d1653aa43 [3.6] bpo-10746: Fix ctypes PEP 3118 type codes for c_long, c_bool, c_int (GH-31) (#3241)
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-08-30 11:40:05 +02:00
Terry Jan Reedy 87c50245b1 [3.6] bpo-31051: Rearrange IDLE condigdialog GenPage into Window, Editor, and Help sections. (GH-3239) (#3240)
(cherry picked from commit 390ead)
2017-08-30 02:47:24 -04:00
Oren Milman c7750c2a3a [3.6] bpo-31243: Fixed PyArg_ParseTuple failure checks. (GH-3171) (#3233)
(cherry picked from commit ba7d736521)
2017-08-29 15:43:32 +03:00
Mariatta 83e5c888ff [3.6] bpo-26656: Improve re.compile documentation (GH-3211) (GH-3225)
- Link to the regular expressions object documentation
- Clarify that it can be used with more than the two methods currently stated.
(cherry picked from commit ed94a8b285)
2017-08-27 22:50:08 -07:00