]> granicus.if.org Git - python/log
python
7 years agobpo-28638: Optimize namedtuple() creation time by minimizing use of exec() (#3454)
Raymond Hettinger [Sun, 10 Sep 2017 17:23:36 +0000 (10:23 -0700)]
bpo-28638: Optimize namedtuple() creation time by minimizing use of exec() (#3454)

* Working draft without _source

* Re-use itemgetter() instances

* Speed-up calls to __new__() with a pre-bound tuple.__new__()

* Add note regarding string interning

* Remove unnecessary create function wrappers

* Minor sync-ups with PR-2736.  Mostly formatting and f-strings

* Bring-in qualname/__module fix-ups from PR-2736

* Formally remove the verbose flag and _source attribute

* Restore a test of potentially problematic field names

* Restore kwonly_args test but without the verbose option

* Adopt Inada's idea to reuse the docstrings for the itemgetters

* Neaten-up a bit

* Add news blurb

* Serhiy pointed-out the need for interning

* Jelle noticed as missing f on an f-string

* Add whatsnew entry for feature removal

* Accede to request for dict literals instead keyword arguments

* Leave the method.__module__ attribute pointing the actual location of the code

* Improve variable names and add a micro-optimization for an non-public helper function

* Simplify by in-lining reuse_itemgetter()

* Arrange steps in more logical order

* Save docstring in local cache instead of interning

7 years agobpo-31406: Fix crash due to lack of type checking in subclassing. (#3477)
Stefan Krah [Sun, 10 Sep 2017 16:08:04 +0000 (18:08 +0200)]
bpo-31406: Fix crash due to lack of type checking in subclassing. (#3477)

7 years agoImprove IncrementalEncoder documentation (GH-2746)
Zhiming Wang [Sun, 10 Sep 2017 06:09:55 +0000 (02:09 -0400)]
Improve IncrementalEncoder documentation (GH-2746)

getstate and setstate are instance methods, same as encode and reset.

7 years agobpo-31403: Remove WITHOUT_THREADS from _decimal. (#3474)
Stefan Krah [Sat, 9 Sep 2017 17:26:22 +0000 (19:26 +0200)]
bpo-31403: Remove WITHOUT_THREADS from _decimal. (#3474)

7 years agoMake `json.dumps()` example to be PEP-8 compliant. (GH-3472)
Sergey Fedoseev [Sat, 9 Sep 2017 16:39:36 +0000 (21:39 +0500)]
Make `json.dumps()` example to be PEP-8 compliant. (GH-3472)

7 years agobpo-31392: Update SSL build for 1.1.0 (#3448)
Steve Dower [Sat, 9 Sep 2017 13:13:06 +0000 (06:13 -0700)]
bpo-31392: Update SSL build for 1.1.0 (#3448)

7 years agobpo-29639: change test.support.HOST to "localhost"
Gregory P. Smith [Sat, 9 Sep 2017 07:30:15 +0000 (00:30 -0700)]
bpo-29639: change test.support.HOST to "localhost"

test.support.HOST should be "localhost" as it was in the past. See the bpo-29639.

Tests that need the IP address should use HOSTv4 (added) or the existing HOSTv6 constant.

This changes the definition and fixes tests that needed updating to deal with HOST being
the hostname rather than the hardcoded IP address.

This is only the first step in addressing https://bugs.python.org/issue29639.

7 years agobpo-26669: Fix nan arg value error in pytime.c (#3085)
Han Lee [Fri, 8 Sep 2017 23:05:05 +0000 (08:05 +0900)]
bpo-26669: Fix nan arg value error in pytime.c (#3085)

* Fix #26669

* Modify NaN check function and error message

* Fix pytime.c when arg is nan

* fix whitespace

7 years agobpo-31400: Improve SSL error handling on Windows (#3463)
Steve Dower [Fri, 8 Sep 2017 22:16:15 +0000 (15:16 -0700)]
bpo-31400: Improve SSL error handling on Windows (#3463)

* bpo-31392: Improve SSL error handling on Windows

* Remove unnecessary Windows mention in NEWS

7 years agobpo-28182: restore backwards compatibility (#3464)
Christian Heimes [Fri, 8 Sep 2017 21:47:58 +0000 (14:47 -0700)]
bpo-28182: restore backwards compatibility (#3464)

b3ad0e5 broke backwards compatibility with OpenSSL < 1.0.2.

Signed-off-by: Christian Heimes <christian@python.org>
7 years agodelete dead locale initialization code for windows (#3461)
Benjamin Peterson [Fri, 8 Sep 2017 21:30:07 +0000 (14:30 -0700)]
delete dead locale initialization code for windows (#3461)

7 years agobpo-31354: Let configure --with-lto work on all builds
octaviansoldea [Fri, 8 Sep 2017 19:14:33 +0000 (12:14 -0700)]
bpo-31354: Let configure --with-lto work on all builds

Allow configure --with-lto to apply to all builds, not just profile-opt builds.

Whether this is actually useful or not must be determined by the person
building CPython using their own toolchain.

My own quick test on x86_64 Debian 9 (gcc 6.3, binutils 2.28) seemed
to suggest that it wasn't, but I expect better toolchains can or will exist
at some point.  The point is to allow it at all.

7 years agobpo-28182: Expose OpenSSL verification results (#3412)
Christian Heimes [Fri, 8 Sep 2017 19:00:19 +0000 (12:00 -0700)]
bpo-28182: Expose OpenSSL verification results (#3412)

The SSL module now raises SSLCertVerificationError when OpenSSL fails to
verify the peer's certificate. The exception contains more information about
the error.

Original patch by Chi Hsuan Yen

Signed-off-by: Christian Heimes <christian@python.org>
7 years agoFixes reference leak (#3457)
Steve Dower [Fri, 8 Sep 2017 18:35:38 +0000 (11:35 -0700)]
Fixes reference leak (#3457)

7 years agoreplace custom table with pyctype (#3456)
Benjamin Peterson [Fri, 8 Sep 2017 17:35:49 +0000 (10:35 -0700)]
replace custom table with pyctype (#3456)

7 years agobpo-31393: Fix the use of PyUnicode_READY(). (#3451)
Serhiy Storchaka [Fri, 8 Sep 2017 06:58:51 +0000 (09:58 +0300)]
bpo-31393: Fix the use of PyUnicode_READY(). (#3451)

7 years agoShow example of itemgetter() applied to a dictionary (#3431)
Raymond Hettinger [Fri, 8 Sep 2017 06:53:07 +0000 (23:53 -0700)]
Show example of itemgetter() applied to a dictionary (#3431)

7 years agoupdate all_name_chars comment after 9020ac7cce97dddad51b285fffc31fe4ddf60898 (#3452)
Benjamin Peterson [Fri, 8 Sep 2017 06:35:53 +0000 (23:35 -0700)]
update all_name_chars comment after 9020ac7cce97dddad51b285fffc31fe4ddf60898 (#3452)

7 years agobpo-30860: Consolidate stateful runtime globals. (#3397)
Eric Snow [Fri, 8 Sep 2017 05:51:28 +0000 (23:51 -0600)]
bpo-30860: Consolidate stateful runtime globals. (#3397)

* group the (stateful) runtime globals into various topical structs
* consolidate the topical structs under a single top-level _PyRuntimeState struct
* add a check-c-globals.py script that helps identify runtime globals

Other globals are excluded (see globals.txt and check-c-globals.py).

7 years agoUpdates PCBuild/readme.txt (#3418)
Steve Dower [Fri, 8 Sep 2017 03:10:29 +0000 (20:10 -0700)]
Updates PCBuild/readme.txt (#3418)

7 years agobpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3 (#1363)
Christian Heimes [Fri, 8 Sep 2017 01:07:00 +0000 (18:07 -0700)]
bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3 (#1363)

* 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>
7 years agooptimize all_name_chars (#3442)
Benjamin Peterson [Fri, 8 Sep 2017 01:06:23 +0000 (18:06 -0700)]
optimize all_name_chars (#3442)

Remove redundant PyUnicode_Check call. Use a static table for checking chars.

7 years agobpo-31036: Allow sphinx and blurb to be found automatically (#3440)
Ned Deily [Fri, 8 Sep 2017 00:17:53 +0000 (17:17 -0700)]
bpo-31036: Allow sphinx and blurb to be found automatically (#3440)

Rather than requiring the path to blurb and/or sphinx-build to be specified to the make rule, enhance the Doc/Makefile to look for each first in a virtual environment created by make venv and, if not found, look on the normal process PATH. This allows the Doc/Makefile to take advantage of an installed spinx-build or blurb and, thus, do the right thing most of the time. Also, make the directory for the venv be configurable and document the `make venv` target.

7 years agobpo-31344: Per-frame control of trace events (GH-3417)
Nick Coghlan [Fri, 8 Sep 2017 00:14:16 +0000 (10:14 +1000)]
bpo-31344: Per-frame control of trace events (GH-3417)

f_trace_lines: enable/disable line trace events
f_trace_opcodes: enable/disable opcode trace events

These are intended primarily for testing of the interpreter
itself, as they make it much easier to emulate signals
arriving at unfortunate times.

7 years agobpo-22635: Update the getstatusoutput docstring. (#3435)
Gregory P. Smith [Thu, 7 Sep 2017 23:11:02 +0000 (16:11 -0700)]
bpo-22635: Update the getstatusoutput docstring. (#3435)

To match the documentation updates already made.
Also renames the local variable used within to match
what it actually holds.

7 years agobpo-27340: Use memoryview in SSLSocket.sendall() (#3384)
Christian Heimes [Thu, 7 Sep 2017 21:18:21 +0000 (14:18 -0700)]
bpo-27340: Use memoryview in SSLSocket.sendall() (#3384)

* bpo-27340: Use memoryview in SSLSocket.sendall()

SSLSocket.sendall() now uses memoryview to create slices of data. This fix
support for all bytes-like object. It is also more efficient and avoids
costly copies.

Signed-off-by: Christian Heimes <christian@python.org>
* Cast view to bytes, fix typo

Signed-off-by: Christian Heimes <christian@python.org>
7 years agobpo-28958: Improve SSLContext error reporting. (#3414)
Christian Heimes [Thu, 7 Sep 2017 21:14:00 +0000 (14:14 -0700)]
bpo-28958: Improve SSLContext error reporting. (#3414)

Signed-off-by: Christian Heimes <christian@python.org>
7 years agobpo-31270: Modification of Pr 3200 (#3427)
Raymond Hettinger [Thu, 7 Sep 2017 21:01:44 +0000 (14:01 -0700)]
bpo-31270: Modification of Pr 3200 (#3427)

* bpo-31270: Simplify documentation of itertools.zip_longest

* Use repeat(). Track num_active.

7 years agoUpdate copyright PSF to 2001-2017 (#3421)
Christian Heimes [Thu, 7 Sep 2017 20:59:13 +0000 (13:59 -0700)]
Update copyright PSF to 2001-2017 (#3421)

Signed-off-by: Christian Heimes <christian@python.org>
7 years agobpo-31294: Fix ZeroMQSocketListener and ZeroMQSocketHandler examples (#3229)
Pablo Galindo [Thu, 7 Sep 2017 20:53:13 +0000 (21:53 +0100)]
bpo-31294: Fix ZeroMQSocketListener and ZeroMQSocketHandler examples (#3229)

* Fix ZeroMQSocketListener and ZeroMQSocketHandler examples

* Use send_json and recv_json to simplify pyzmq interfacing

* Add News entry

7 years agobpo-31330: Clarify that RawTextHelpFormatter collapses repeated newlines. (#3272)
Elena Oat [Thu, 7 Sep 2017 20:06:45 +0000 (23:06 +0300)]
bpo-31330: Clarify that RawTextHelpFormatter collapses repeated newlines. (#3272)

Also provide a solution if the user wants to keep multiple blank lines.

7 years agobpo-30389 Adds detection of VS 2017 to distutils._msvccompiler (#1632)
Steve Dower [Thu, 7 Sep 2017 18:49:23 +0000 (11:49 -0700)]
bpo-30389 Adds detection of VS 2017 to distutils._msvccompiler (#1632)

7 years agobpo-31373: fix undefined floating-point demotions (#3396)
Benjamin Peterson [Thu, 7 Sep 2017 18:13:59 +0000 (11:13 -0700)]
bpo-31373: fix undefined floating-point demotions (#3396)

7 years agoremove current_filename optimization from marshal (#3423) (closes bpo-31384)
Benjamin Peterson [Thu, 7 Sep 2017 17:49:12 +0000 (10:49 -0700)]
remove current_filename optimization from marshal (#3423) (closes bpo-31384)

7 years agobpo-31370: Remove support for threads-less builds (#3385)
Antoine Pitrou [Thu, 7 Sep 2017 16:56:24 +0000 (18:56 +0200)]
bpo-31370: Remove support for threads-less builds (#3385)

* Remove Setup.config
* Always define WITH_THREAD for compatibility.

7 years agoAdd props file for nuget packages (#3410)
Steve Dower [Thu, 7 Sep 2017 02:29:10 +0000 (19:29 -0700)]
Add props file for nuget packages (#3410)

7 years agoUpdate multissl test helper (#3349)
Christian Heimes [Thu, 7 Sep 2017 01:59:22 +0000 (18:59 -0700)]
Update multissl test helper (#3349)

Signed-off-by: Christian Heimes <christian@python.org>
7 years agoAvoid UB in test selection macro. (#3407)
Devin Jeanpierre [Thu, 7 Sep 2017 01:00:47 +0000 (18:00 -0700)]
Avoid UB in test selection macro. (#3407)

This fixes the gcc "warning: this use of "defined" may not be portable [-Wexpansion-to-defined]"

See discussion in http://bugs.python.org/issue29505

7 years agobpo-22635: subprocess.getstatusoutput doc update. (#3398)
Gregory P. Smith [Thu, 7 Sep 2017 00:39:23 +0000 (17:39 -0700)]
bpo-22635: subprocess.getstatusoutput doc update. (#3398)

The `subprocess.getstatusoutput` API was inadvertently changed
in Python 3.3.4.  Document the change, it is too late to undo the
API change now as it has shipped in many stable releases.

7 years agobpo-31358: Pull zlib out of the repository (GH-3375)
Zachary Ware [Thu, 7 Sep 2017 00:29:37 +0000 (17:29 -0700)]
bpo-31358: Pull zlib out of the repository (GH-3375)

Also enable building externals by default on Windows, use PCbuild\build.bat's -E option to disable it.

7 years agobpo-30465: Fix lineno and col_offset in fstring AST nodes (#1800)
Łukasz Langa [Thu, 7 Sep 2017 00:27:58 +0000 (17:27 -0700)]
bpo-30465: Fix lineno and col_offset in fstring AST nodes (#1800)

For f-string ast nodes, fix the line and columns so that tools such as flake8 can identify them correctly.

7 years agoCreate PULL_REQUEST_TEMPLATE.md (GH-3404)
Mariatta [Thu, 7 Sep 2017 00:27:05 +0000 (17:27 -0700)]
Create PULL_REQUEST_TEMPLATE.md (GH-3404)

Explain that backport PR should include branch name and the original PR number.

7 years agobpo-14191 Add parse_intermixed_args. (#3319)
R. David Murray [Thu, 7 Sep 2017 00:25:40 +0000 (20:25 -0400)]
bpo-14191 Add parse_intermixed_args. (#3319)

This adds support for parsing a command line where options and positionals are intermixed as is common in many unix commands. This is paul.j3's patch with a few tweaks.

7 years agobpo-21649: Add RFC 7525 and Mozilla server side TLS (#3387)
Christian Heimes [Wed, 6 Sep 2017 23:19:56 +0000 (16:19 -0700)]
bpo-21649: Add RFC 7525 and Mozilla server side TLS (#3387)

Signed-off-by: Christian Heimes <christian@python.org>
7 years agoRemove all mention of Windows IA-64 support (GH-3389)
Zachary Ware [Wed, 6 Sep 2017 22:45:25 +0000 (15:45 -0700)]
Remove all mention of Windows IA-64 support (GH-3389)

It was mostly removed long ago.

7 years agobpo-27584: New addition of vSockets to the python socket module (#2489)
caavery [Wed, 6 Sep 2017 22:18:10 +0000 (18:18 -0400)]
bpo-27584: New addition of vSockets to the python socket module (#2489)

* bpo-27584: New addition of vSockets to the python socket module

Support for AF_VSOCK on Linux only

* bpo-27584: Fixes for V2

Fixed syntax and naming problems.
Fixed #ifdef AF_VSOCK checking
Restored original aclocal.m4

* bpo-27584: Fixes for V3

Added checking for fcntl and thread modules.

* bpo-27584: Fixes for V4

Fixed white space error

* bpo-27584: Fixes for V5

Added back comma in (CID, port).

* bpo-27584: Fixes for V6

Added news file.
socket.rst now reflects first Linux introduction of AF_VSOCK.
Fixed get_cid in test_socket.py.
Replaced PyLong_FromLong with PyLong_FromUnsignedLong in socketmodule.c
Got rid of extra AF_VSOCK #define.
Added sockaddr_vm to sock_addr.

* bpo-27584: Fixes for V7

Minor cleanup.

* bpo-27584: Fixes for V8

Put back #undef AF_VSOCK as it is  necessary when vm_sockets.h is not installed.

7 years agoFixes Tix build by correcting the directories used by Tcl and Tk. (#3391)
Steve Dower [Wed, 6 Sep 2017 20:55:42 +0000 (13:55 -0700)]
Fixes Tix build by correcting the directories used by Tcl and Tk. (#3391)

7 years agobpo-30912: Don't check the content of ffi.h (GH-2687)
Shlomi Fish [Wed, 6 Sep 2017 20:19:19 +0000 (23:19 +0300)]
bpo-30912: Don't check the content of ffi.h (GH-2687)

Various platforms have various methods of handling multiarch libffi which probably won't match the previously looked-for defines.  Now we just make sure that ffi.h is available.

7 years agobpo-29505: Add fuzz tests for float(str), int(str), unicode(str) (#2878)
Devin Jeanpierre [Wed, 6 Sep 2017 18:15:35 +0000 (11:15 -0700)]
bpo-29505: Add fuzz tests for float(str), int(str), unicode(str) (#2878)

Add basic fuzz tests for a few common builtin functions.

This is an easy place to start, and these functions are probably safe.
We'll want to add more fuzz tests later.  Lets bootstrap using these.

While the fuzz tests are included in CPython and compiled / tested on a
very basic level inside CPython itself, the actual fuzzing happens as
part of oss-fuzz (https://github.com/google/oss-fuzz). The reason to
include the tests in CPython is to make sure that they're maintained
as part of the CPython project, especially when (as some eventually
will) they use internal implementation details in the test.

(This will be necessary sometimes because e.g. the fuzz test should
never enter Python's interpreter loop, whereas some APIs only expose
themselves publicly as Python functions.)

This particular set of changes is part of testing Python's builtins,
tracked internally at Google by b/37562550.

The _xxtestfuzz module that this change adds need not be shipped with binary distributions of Python.

7 years agobpo-31340: Change to building with MSVC v141 (included with Visual Studio 2017) ...
Steve Dower [Wed, 6 Sep 2017 17:01:38 +0000 (10:01 -0700)]
bpo-31340: Change to building with MSVC v141 (included with Visual Studio 2017) (#3311)

7 years agoRevert "pytime: include winsock2, so we can have a complete timeval type (#3377)...
Antoine Pitrou [Wed, 6 Sep 2017 11:31:09 +0000 (13:31 +0200)]
Revert "pytime: include winsock2, so we can have a complete timeval type (#3377)" (#3383)

This reverts commit 833860615bedfd2484ac0623d6f01ff0578ba09f, as it broke Windows builds.

7 years agobpo-31178: Avoid concatenating bytes with str in subprocess error (#3066)
Ammar Askar [Wed, 6 Sep 2017 06:41:30 +0000 (02:41 -0400)]
bpo-31178: Avoid concatenating bytes with str in subprocess error (#3066)

Avoid concatenating bytes with str in the typically rare subprocess error path (exec failed). Includes a mock based unittest to exercise the codepath.

7 years agobpo-29781: Fix SSLObject.version before handshake (#3364)
Christian Heimes [Wed, 6 Sep 2017 04:55:40 +0000 (21:55 -0700)]
bpo-29781: Fix SSLObject.version before handshake (#3364)

SSLObject.version() now correctly returns None when handshake over BIO has
not been performed yet.

Signed-off-by: Christian Heimes <christian@python.org>
7 years agoStop test_xmlrpc from writing to sys.stderr (#3359)
Christian Heimes [Wed, 6 Sep 2017 04:43:46 +0000 (21:43 -0700)]
Stop test_xmlrpc from writing to sys.stderr (#3359)

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>
7 years agoRevert "bpo-30860: Consolidate stateful runtime globals." (#3379)
Eric Snow [Wed, 6 Sep 2017 04:43:08 +0000 (21:43 -0700)]
Revert "bpo-30860: Consolidate stateful runtime globals." (#3379)

Windows buildbots started failing due to include-related errors.

7 years agopytime: include winsock2, so we can have a complete timeval type (#3377)
Benjamin Peterson [Wed, 6 Sep 2017 03:45:48 +0000 (20:45 -0700)]
pytime: include winsock2, so we can have a complete timeval type (#3377)

7 years agocorrect initialization code (#3376)
Benjamin Peterson [Wed, 6 Sep 2017 03:19:12 +0000 (20:19 -0700)]
correct initialization code (#3376)

Explicitly initialize struct members rather than relying on compiler extensions.

7 years agobpo-30860: Consolidate stateful runtime globals. (#2594)
Eric Snow [Wed, 6 Sep 2017 01:26:16 +0000 (18:26 -0700)]
bpo-30860: Consolidate stateful runtime globals. (#2594)

* group the (stateful) runtime globals into various topical structs
* consolidate the topical structs under a single top-level _PyRuntimeState struct
* add a check-c-globals.py script that helps identify runtime globals

Other globals are excluded (see globals.txt and check-c-globals.py).

7 years agobpo-31355: Travis CI: remove the macOS job (#3367)
Victor Stinner [Wed, 6 Sep 2017 00:57:14 +0000 (02:57 +0200)]
bpo-31355: Travis CI: remove the macOS job (#3367)

7 years agobpo-31350: Optimize get_event_loop and _get_running_loop (#3347)
jimmylai [Wed, 6 Sep 2017 00:36:59 +0000 (17:36 -0700)]
bpo-31350: Optimize get_event_loop and _get_running_loop (#3347)

* 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

7 years agobpo-31320: No traceback to sys.stderr in test_ssl (#3360)
Christian Heimes [Tue, 5 Sep 2017 23:37:09 +0000 (16:37 -0700)]
bpo-31320: No traceback to sys.stderr in test_ssl (#3360)

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>
7 years agolink to legacy doc on the non-legacy website (#3362)
Benjamin Peterson [Tue, 5 Sep 2017 23:24:39 +0000 (16:24 -0700)]
link to legacy doc on the non-legacy website (#3362)

7 years agobpo-30662: fixed OrderedDict.__init__ docstring re PEP 468 (#2179)
Jonathan Eunice [Tue, 5 Sep 2017 23:23:49 +0000 (19:23 -0400)]
bpo-30662: fixed OrderedDict.__init__ docstring re PEP 468 (#2179)

* 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

7 years ago_pickle: Fix whichmodule() (#3358)
Victor Stinner [Tue, 5 Sep 2017 21:30:16 +0000 (23:30 +0200)]
_pickle: Fix whichmodule() (#3358)

_PyUnicode_FromId() can return NULL: replace Py_INCREF() with
Py_XINCREF().

Fix coverity report: CID 1417269.

7 years agoLink to blurb on PyPI in the NEWS.d READMEs. (#3323)
Gregory P. Smith [Tue, 5 Sep 2017 17:38:05 +0000 (10:38 -0700)]
Link to blurb on PyPI in the NEWS.d READMEs. (#3323)

7 years agoConceptually, roots is a set. Also searching it as a set is a tiny bit faster (...
Raymond Hettinger [Tue, 5 Sep 2017 16:40:44 +0000 (09:40 -0700)]
Conceptually, roots is a set.  Also searching it as a set is a tiny bit faster (#3338)

7 years agobpo-31343: Include sys/sysmacros.h (#3318)
Christian Heimes [Tue, 5 Sep 2017 13:53:09 +0000 (15:53 +0200)]
bpo-31343: Include sys/sysmacros.h (#3318)

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>
7 years agobpo-30102: Call OPENSSL_add_all_algorithms_noconf (#3112)
Christian Heimes [Tue, 5 Sep 2017 13:47:11 +0000 (15:47 +0200)]
bpo-30102: Call OPENSSL_add_all_algorithms_noconf (#3112)

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>
7 years agoPrevent a few make suspicious warnings. (#3341)
Ned Deily [Tue, 5 Sep 2017 08:34:47 +0000 (01:34 -0700)]
Prevent a few make suspicious warnings. (#3341)

7 years agoInclude additional changes to support blurbified NEWS (#3340)
Ned Deily [Tue, 5 Sep 2017 07:10:31 +0000 (00:10 -0700)]
Include additional changes to support blurbified NEWS (#3340)

7 years agoSimplify NEWS entry to prevent suspicious warnings. (#3339)
Ned Deily [Tue, 5 Sep 2017 06:23:04 +0000 (23:23 -0700)]
Simplify NEWS entry to prevent suspicious warnings. (#3339)

7 years agobpo-31347: _PyObject_FastCall_Prepend: do not call memcpy if args might not be null...
Benjamin Peterson [Tue, 5 Sep 2017 05:23:42 +0000 (22:23 -0700)]
bpo-31347: _PyObject_FastCall_Prepend: do not call memcpy if args might not be null (#3329)

Passing NULL as the second argument to to memcpy is undefined behavior even if the size is 0.

7 years agoRevert "bpo-17852: Maintain a list of BufferedWriter objects. Flush them on exit...
Neil Schemenauer [Tue, 5 Sep 2017 05:13:17 +0000 (22:13 -0700)]
Revert "bpo-17852: Maintain a list of BufferedWriter objects.  Flush them on exit. (#1908)" (#3337)

This reverts commit e38d12ed34870c140016bef1e0ff10c8c3d3f213.

7 years agobpo-17852: Maintain a list of BufferedWriter objects. Flush them on exit. (#1908)
Neil Schemenauer [Tue, 5 Sep 2017 03:18:38 +0000 (20:18 -0700)]
bpo-17852: Maintain a list of BufferedWriter objects.  Flush them on exit. (#1908)

* Maintain a list of BufferedWriter objects.  Flush them on exit.

In Python 3, the buffer and the underlying file object are separate
and so the order in which objects are finalized matters.  This is
unlike Python 2 where the file and buffer were a single object and
finalization was done for both at the same time.  In Python 3, if
the file is finalized and closed before the buffer then the data in
the buffer is lost.

This change adds a doubly linked list of open file buffers.  An atexit
hook ensures they are flushed before proceeding with interpreter
shutdown.  This is addition does not remove the need to properly close
files as there are other reasons why buffered data could get lost during
finalization.

Initial patch by Armin Rigo.

* Use weakref.WeakSet instead of WeakKeyDictionary.

* Simplify buffered double-linked list types.

* In _flush_all_writers(), suppress errors from flush().

* Remove NEWS entry, use blurb.

7 years agoFix terminology in comment and add more design rationale. (#3335)
Raymond Hettinger [Tue, 5 Sep 2017 01:54:16 +0000 (18:54 -0700)]
Fix terminology in comment and add more design rationale. (#3335)

* Fix terminology in comment and add more design rationale.

* Fix extra space

7 years agoAdd comment to explain the implications of not sorting keywords (#3331)
Raymond Hettinger [Tue, 5 Sep 2017 00:47:53 +0000 (17:47 -0700)]
Add comment to explain the implications of not sorting keywords (#3331)

In Python 3.6, sorted() was removed from _make_key() for the lru_cache and instead rely on guaranteed keyword argument order preservation.  This makes keyword argument handling faster but it also causes multiple callers with a different keyword argument order to be cached as separate items.  Depending on your point of view, this is either a performance regression (increased number of cache misses) or a performance enhancement (faster computation of keys).

7 years agobpo-31170: Update libexpat from 2.2.3 to 2.2.4 (#3315)
Victor Stinner [Mon, 4 Sep 2017 23:58:08 +0000 (01:58 +0200)]
bpo-31170: Update libexpat from 2.2.3 to 2.2.4 (#3315)

* 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.

7 years agobpo-28411: Remove "modules" field from Py_InterpreterState. (#1638)
Eric Snow [Mon, 4 Sep 2017 23:54:09 +0000 (17:54 -0600)]
bpo-28411: Remove "modules" field from Py_InterpreterState. (#1638)

sys.modules is the one true source.

7 years agorandom_triangular: sqrt() is more accurate than **0.5 (#3317)
Raymond Hettinger [Mon, 4 Sep 2017 23:51:06 +0000 (16:51 -0700)]
random_triangular:  sqrt() is more accurate than **0.5 (#3317)

7 years agoTravis: use ccache (#3307)
Christian Heimes [Mon, 4 Sep 2017 23:48:54 +0000 (01:48 +0200)]
Travis: use ccache (#3307)

7 years agoremove IRIX support (closes bpo-31341) (#3310)
Benjamin Peterson [Mon, 4 Sep 2017 23:36:05 +0000 (16:36 -0700)]
remove IRIX support (closes bpo-31341) (#3310)

See PEP 11.

7 years agoCode clean-up. Remove unnecessary pre-increment before the loop starts. (#3312)
Raymond Hettinger [Mon, 4 Sep 2017 23:07:06 +0000 (16:07 -0700)]
Code clean-up.  Remove unnecessary pre-increment before the loop starts. (#3312)

7 years agoRegen Moduls/clinic/_ssl.c.h (GH-3320)
Zachary Ware [Mon, 4 Sep 2017 22:45:18 +0000 (15:45 -0700)]
Regen Moduls/clinic/_ssl.c.h (GH-3320)

Broken in GH-2079

7 years agobpo-30502: Fix handling of long oids in ssl. (#2909)
Serhiy Storchaka [Mon, 4 Sep 2017 22:28:53 +0000 (01:28 +0300)]
bpo-30502: Fix handling of long oids in ssl. (#2909)

7 years agoCache externals, depending on changes to PCbuild (#3308)
Zachary Ware [Mon, 4 Sep 2017 21:59:02 +0000 (14:59 -0700)]
Cache externals, depending on changes to PCbuild (#3308)

7 years agobpo-30622: Change NPN detection: (#2079)
Melvyn Sopacua [Mon, 4 Sep 2017 21:35:15 +0000 (23:35 +0200)]
bpo-30622: Change NPN detection: (#2079)

* 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:

#if defined(OPENSSL_NO_NEXTPROTONEG) && \
!defined(OPENSSL_NPN_NEGOTIATED)
# define OPENSSL_NPN_UNSUPPORTED 0
# define OPENSSL_NPN_NEGOTIATED 1
# define OPENSSL_NPN_NO_OVERLAP 2
#endif

[1] https://github.com/openssl/openssl/commit/68b33cc5c7

7 years agoWhat's New for bpo-1198569 (#3303)
Barry Warsaw [Mon, 4 Sep 2017 21:29:27 +0000 (17:29 -0400)]
What's New for bpo-1198569 (#3303)

7 years agoFixes doc/make.bat to properly handle quoted paths. (#3302)
Steve Dower [Mon, 4 Sep 2017 21:26:27 +0000 (14:26 -0700)]
Fixes doc/make.bat to properly handle quoted paths. (#3302)

7 years agoremove configure.ac support for SGI_ABI (#3294)
Benjamin Peterson [Mon, 4 Sep 2017 21:05:32 +0000 (14:05 -0700)]
remove configure.ac support for SGI_ABI (#3294)

7 years agoremote note about IRIX in aifc (#3299)
Benjamin Peterson [Mon, 4 Sep 2017 20:32:34 +0000 (13:32 -0700)]
remote note about IRIX in aifc (#3299)

This comment hasn't been true since Python 3.0.

7 years agobpo-1198569: Allow string.Template braced pattern to be different (#3288)
Barry Warsaw [Mon, 4 Sep 2017 20:32:10 +0000 (16:32 -0400)]
bpo-1198569: Allow string.Template braced pattern to be different (#3288)

* bpo-1198569: Allow the braced pattern to be different

``string.Template`` subclasses can optionally define ``braceidpattern`` if
they want to specify different placeholder patterns inside and outside the
braces.  If None (the default) it falls back to ``idpattern``.

7 years agoBlurbify master branch. (#3298)
larryhastings [Mon, 4 Sep 2017 20:30:19 +0000 (13:30 -0700)]
Blurbify master branch. (#3298)

Blurbify master branch.

7 years agobpo-25674: remove sha256.tbs-internet.com ssl test (#3297)
Christian Heimes [Mon, 4 Sep 2017 20:26:01 +0000 (22:26 +0200)]
bpo-25674: remove sha256.tbs-internet.com ssl test (#3297)

Signed-off-by: Christian Heimes <christian@python.org>
7 years agoClarify nature of parse_args 'args' argument. (#3292)
R. David Murray [Mon, 4 Sep 2017 20:17:26 +0000 (16:17 -0400)]
Clarify nature of parse_args 'args' argument. (#3292)

Patch by Paul.j3.  Includes an unrelated but useful addition to the
optparse porting section.

7 years agoAdd references to modules I am responsible for (#3291)
Raymond Hettinger [Mon, 4 Sep 2017 19:31:15 +0000 (12:31 -0700)]
Add references to modules I am responsible for (#3291)

7 years agoUse a team to maintain the email related packages. (#3290)
Barry Warsaw [Mon, 4 Sep 2017 19:19:26 +0000 (15:19 -0400)]
Use a team to maintain the email related packages. (#3290)

7 years agoImprove clarity (and small speed-up) by using tuple unpacking (#3289)
Raymond Hettinger [Mon, 4 Sep 2017 18:47:58 +0000 (11:47 -0700)]
Improve clarity (and small speed-up) by using tuple unpacking (#3289)

7 years agoremove check for bug last seem in Solaris 9 (#3285)
Benjamin Peterson [Mon, 4 Sep 2017 17:52:51 +0000 (10:52 -0700)]
remove check for bug last seem in Solaris 9 (#3285)

7 years agoChange code owners for hashlib and ssl to the crypto team (#3284)
Alex Gaynor [Mon, 4 Sep 2017 17:40:45 +0000 (13:40 -0400)]
Change code owners for hashlib and ssl to the crypto team (#3284)

* Change code owners for hashlib and ssl to the crypto team

* Include the core CSPRNG for the crypto-team

7 years agobpo-31281: Fix pathlib.Path incompatibility in fileinput (gh-3208)
Zhiming Wang [Mon, 4 Sep 2017 17:37:24 +0000 (01:37 +0800)]
bpo-31281: Fix pathlib.Path incompatibility in fileinput (gh-3208)

Fix fileinput with inplace=True to accept pathlib.Path objects.