]> granicus.if.org Git - python/log
python
7 years agobpo-31458: Update Misc/NEWS link in What's New page (GH-3555)
Mariatta [Wed, 13 Sep 2017 23:47:33 +0000 (16:47 -0700)]
bpo-31458: Update Misc/NEWS link in What's New page (GH-3555)

Update the link from Misc/NEWS to Misc/NEWS.d

7 years agobpo-31234: Try to fix lock_tests warning (#3557)
Victor Stinner [Wed, 13 Sep 2017 23:41:08 +0000 (16:41 -0700)]
bpo-31234: Try to fix lock_tests warning (#3557)

Try to fix the "Warning -- threading_cleanup() failed to cleanup 1
threads" warning in test.lock_tests: wait a little bit longer to give
time to the threads to complete.

Warning seen on test_thread and test_importlib.

7 years agobpo-28556: Minor updates to typing module (#3550)
Ivan Levkivskyi [Wed, 13 Sep 2017 23:25:15 +0000 (01:25 +0200)]
bpo-28556: Minor updates to typing module (#3550)

* Copy changes to typing from upstream repo
* Add NEWS entry

7 years agobpo-31418: Fix an assertion failure in PyErr_WriteUnraisable() in case of an exceptio...
Oren Milman [Wed, 13 Sep 2017 22:30:05 +0000 (01:30 +0300)]
bpo-31418: Fix an assertion failure in PyErr_WriteUnraisable() in case of an exception with a bad __module__ attribute. (#3539)

7 years agobpo-31234: threading_cleanup() now warns immediately (#3138)
Victor Stinner [Wed, 13 Sep 2017 20:42:00 +0000 (13:42 -0700)]
bpo-31234: threading_cleanup() now warns immediately (#3138)

support.threading_cleanup() waits for 1 second before emitting a
warning if there are threads running in the background. With this
change, it now emits the warning immediately, to be able to catch
bugs more easily.

7 years agoUpdate subprocess.communicate() docstring.
Joel Schaerer [Wed, 13 Sep 2017 19:11:20 +0000 (21:11 +0200)]
Update subprocess.communicate() docstring.

Explicitly state that communicate() closes stdin after writing input to it.

7 years agobpo-31234, socket.create_connection(): Fix ref cycle (#3546)
Victor Stinner [Wed, 13 Sep 2017 17:10:10 +0000 (10:10 -0700)]
bpo-31234, socket.create_connection(): Fix ref cycle (#3546)

7 years agobpo-31234: Fix dangling thread in test_ftplib (#3544)
Victor Stinner [Wed, 13 Sep 2017 13:43:58 +0000 (06:43 -0700)]
bpo-31234: Fix dangling thread in test_ftplib (#3544)

Clear also self.server_thread attribute in TestTimeouts.tearDown().

7 years agobpo-31448, test_poplib: Fix ResourceWarning (#3542)
Victor Stinner [Wed, 13 Sep 2017 12:53:10 +0000 (05:53 -0700)]
bpo-31448, test_poplib: Fix ResourceWarning (#3542)

Call POP3.close(), don't close close directly the sock attribute.

7 years agoTravis CI: run coverage test using --fail-env-changed (#3541)
Victor Stinner [Wed, 13 Sep 2017 12:17:27 +0000 (05:17 -0700)]
Travis CI: run coverage test using --fail-env-changed (#3541)

7 years agobpo-31234: Fix dangling thread in test_ftp/poplib (#3540)
Victor Stinner [Wed, 13 Sep 2017 10:58:25 +0000 (03:58 -0700)]
bpo-31234: Fix dangling thread in test_ftp/poplib (#3540)

Explicitly clear the server attribute in test_ftplib and test_poplib
to prevent dangling thread.

7 years agobpo-31233: socketserver.ThreadingMixIn.server_close() (#3523)
Victor Stinner [Wed, 13 Sep 2017 08:47:22 +0000 (01:47 -0700)]
bpo-31233: socketserver.ThreadingMixIn.server_close() (#3523)

socketserver.ThreadingMixIn now keeps a list of non-daemonic threads
to wait until all these threads complete in server_close().

Reenable test_logging skipped tests.

Fix SocketHandlerTest.tearDown(): close the socket handler before
stopping the server, so the server can join threads.

7 years agobpo-30830: logging.config.listen() calls server_close() (#3524)
Victor Stinner [Wed, 13 Sep 2017 08:44:08 +0000 (01:44 -0700)]
bpo-30830: logging.config.listen() calls server_close() (#3524)

The ConfigSocketReceiver.serve_until_stopped() method from
logging.config.listen() now calls server_close() (of
socketserver.ThreadingTCPServer) rather than closing manually the
socket.

While this change has no effect yet, it will help to prevent dangling
threads once ThreadingTCPServer.server_close() will join spawned
threads (bpo-31233).

7 years agoMention enum as an ex (#2982)
Louie Lu [Wed, 13 Sep 2017 04:44:14 +0000 (12:44 +0800)]
Mention enum as an ex (#2982)

7 years agobpo-31394: Make tokenize.rst PEP 8-compliant (GH-3526)
Mariatta [Wed, 13 Sep 2017 04:00:00 +0000 (21:00 -0700)]
bpo-31394: Make tokenize.rst PEP 8-compliant (GH-3526)

The last commit contained lines longer than 80 characters.

7 years agobpo-31394: Clarify documentation about token type attribute (GH-3469)
Aivar Annamaa [Wed, 13 Sep 2017 03:24:03 +0000 (06:24 +0300)]
bpo-31394: Clarify documentation about token type attribute (GH-3469)

Make it clear that Ellipsis tokens also have type attribute set to token.OP.

7 years agobpo-31249: Fix test_concurrent_futures dangling thread (#3521)
Victor Stinner [Wed, 13 Sep 2017 00:05:53 +0000 (17:05 -0700)]
bpo-31249: Fix test_concurrent_futures dangling thread (#3521)

ProcessPoolShutdownTest.test_del_shutdown() now closes the call queue
and joins its thread, to prevent leaking a dangling thread.

7 years agobpo-31234: Enhance test_thread.test_forkinthread() (#3516)
Victor Stinner [Tue, 12 Sep 2017 17:49:22 +0000 (10:49 -0700)]
bpo-31234: Enhance test_thread.test_forkinthread() (#3516)

* test_thread.test_forkinthread() now waits until the thread completes.
* Check the status in the test method, not in the thread function
* Don't ignore RuntimeError anymore: since the commit
  346cbd351ee0dd3ab9cb9f0e4cb625556707877e (bpo-16500,
  os.register_at_fork(), os.fork() cannot fail anymore with
  RuntimeError.
* Replace 0.01 literal with a new POLL_SLEEP constant
* test_forkinthread(): test if os.fork() exists rather than testing
  the platform.

7 years agobpo-31428: Prevent raising a SystemError in case the memo arg of ElementTree.Element...
Oren Milman [Tue, 12 Sep 2017 14:39:15 +0000 (17:39 +0300)]
bpo-31428: Prevent raising a SystemError in case the memo arg of ElementTree.Element.__deepcopy__() isn't a dictionary. (#3512)

7 years agobpo-31421: Document how IDLE runs tkinter programs. (#3513)
Terry Jan Reedy [Tue, 12 Sep 2017 13:05:16 +0000 (09:05 -0400)]
bpo-31421: Document how IDLE runs tkinter programs. (#3513)

IDLE calls tcl/tk update in the background in order to make live
interaction and experimentatin with tkinter applications much easier.

7 years agobpo-27099: Finish updating IDLE doc and help text. (#3510)
Terry Jan Reedy [Tue, 12 Sep 2017 11:45:15 +0000 (07:45 -0400)]
bpo-27099: Finish updating IDLE doc and help text. (#3510)

As needed for the conversion of extensions to features.

7 years agobpo-30860: Move windows.h include out of internal/*.h. (#3458)
Eric Snow [Tue, 12 Sep 2017 01:30:43 +0000 (18:30 -0700)]
bpo-30860: Move windows.h include out of internal/*.h. (#3458)

PR #3397 introduced a large number of warnings to the Windows build. This patch fixes them.

7 years agobpo-30860: Fix a refleak. (#3506)
Eric Snow [Tue, 12 Sep 2017 00:59:22 +0000 (17:59 -0700)]
bpo-30860: Fix a refleak. (#3506)

* Drop warnoptions from PyInterpreterState.

* Drop xoptions from PyInterpreterState.

* Don't set warnoptions and _xoptions again.

* Decref after adding to sys.__dict__.

* Drop an unused macro.

* Check sys.xoptions *before* we delete it.

7 years agobpo-30860: Always provide serialno. (#3507)
Eric Snow [Tue, 12 Sep 2017 00:02:24 +0000 (17:02 -0700)]
bpo-30860: Always provide serialno. (#3507)

This fixes bpo-31407.

7 years agobpo-31416: Fix assertion failures in case of a bad warnings.filters or warnings.defau...
Oren Milman [Mon, 11 Sep 2017 21:18:09 +0000 (00:18 +0300)]
bpo-31416: Fix assertion failures in case of a bad warnings.filters or warnings.defaultaction. (#3496)

Patch by Oren Milman.

7 years agobpo-30928: Update idlelib/NEWS.txt to 2017-09-11. (#3503)
Terry Jan Reedy [Mon, 11 Sep 2017 20:43:26 +0000 (16:43 -0400)]
bpo-30928: Update idlelib/NEWS.txt to 2017-09-11. (#3503)

7 years agobpo-31414: IDLE -- fix tk entry box tests by deleting first. (#3501)
Terry Jan Reedy [Mon, 11 Sep 2017 20:02:33 +0000 (16:02 -0400)]
bpo-31414: IDLE -- fix tk entry box tests by deleting first. (#3501)

Adding to an int entry is not the same as deleting and inserting
because int('') will fail.

7 years agobpo-30860: Add Include/internal/ in "make tags" (#3498)
Victor Stinner [Mon, 11 Sep 2017 16:34:36 +0000 (09:34 -0700)]
bpo-30860: Add Include/internal/ in "make tags" (#3498)

7 years agotest_ssl: Implement timeout in ssl_io_loop() (#3500)
Victor Stinner [Mon, 11 Sep 2017 16:34:24 +0000 (09:34 -0700)]
test_ssl: Implement timeout in ssl_io_loop() (#3500)

The timeout parameter was not used.

7 years agoRemove a null statement that was necessary for --without-threads (#3478)
Zackery Spytz [Mon, 11 Sep 2017 10:37:10 +0000 (04:37 -0600)]
Remove a null statement that was necessary for --without-threads (#3478)

7 years agobpo-31373: remove overly strict float range checks (#3486)
Benjamin Peterson [Mon, 11 Sep 2017 06:50:46 +0000 (23:50 -0700)]
bpo-31373: remove overly strict float range checks (#3486)

This undoes a853a8ba7850381d49b284295dd6f0dc491dbe44 except for the pytime.c
parts. We want to continue to allow IEEE 754 doubles larger than FLT_MAX to be
rounded into finite floats. Tests were added to very this behavior.

7 years agobpo-31411: Prevent raising a SystemError in case warnings.onceregistry is not a dicti...
Oren Milman [Mon, 11 Sep 2017 06:28:39 +0000 (09:28 +0300)]
bpo-31411: Prevent raising a SystemError in case warnings.onceregistry is not a dictionary. (#3485)

7 years agobpo-30781: IDLE: Fix help button on configdialog (#3238)
Cheryl Sabella [Mon, 11 Sep 2017 02:41:10 +0000 (22:41 -0400)]
bpo-30781: IDLE: Fix help button on configdialog (#3238)

This fixes an omission in the ttk conversion patch for this issue, hence no new news.
Patch by Cheryl Sabella.

7 years agobpo-27099: IDLE - Convert built-in extensions to regular features (#2494)
wohlganger [Sun, 10 Sep 2017 21:19:47 +0000 (16:19 -0500)]
bpo-27099: IDLE - Convert built-in extensions to regular features (#2494)

About 10 IDLE features were implemented as supposedly optional
extensions.  Their different behavior could be confusing or worse for
users and not good for maintenance.  Hence the conversion.

The main difference for users is that user configurable key bindings
for builtin features are now handled uniformly.  Now, editing a binding
in a keyset only affects its value in the keyset.  All bindings are
defined together in the system-specific default keysets in config-
extensions.def.  All custom keysets are saved as a whole in config-
extension.cfg.  All take effect as soon as one clicks Apply or Ok.

The affected events are '<<force-open-completions>>', '<<expand-word>>',
'<<force-open-calltip>>', '<<flash-paren>>', '<<format-paragraph>>',
'<<run-module>>', '<<check-module>>', and '<<zoom-height>>'.  Any
(global) customizations made before 3.6.3 will not affect their keyset-
specific customization after 3.6.3. and vice versa.

Inital patch by Charles Wohlganger, revised by Terry Jan Reedy.

7 years agoSimplify run_tests.py (#3482)
Antoine Pitrou [Sun, 10 Sep 2017 18:32:13 +0000 (20:32 +0200)]
Simplify run_tests.py (#3482)

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)