]> granicus.if.org Git - python/log
python
7 years agobpo-11015: Update test.support documentation (GH-5610)
Cheryl Sabella [Sun, 11 Feb 2018 13:10:42 +0000 (08:10 -0500)]
bpo-11015: Update test.support documentation (GH-5610)

7 years agobpo-32792: Preserve mapping order in ChainMap() (GH-5586)
Raymond Hettinger [Sun, 11 Feb 2018 08:30:31 +0000 (00:30 -0800)]
bpo-32792: Preserve mapping order in ChainMap() (GH-5586)

7 years agobpo-32800: Update link to w3c doc for xml default namespaces (GH-5609)
sblondon [Sat, 10 Feb 2018 22:39:43 +0000 (23:39 +0100)]
bpo-32800: Update link to w3c doc for xml default namespaces (GH-5609)

The new link is given in a red box on the old page.

7 years agotravis: Use -O3 option (GH-5599)
INADA Naoki [Sat, 10 Feb 2018 11:35:17 +0000 (20:35 +0900)]
travis: Use -O3 option (GH-5599)

We don't use debugger on Travis.

7 years agobpo-30688: Import unicodedata only when needed. (GH-5606)
Zhou Fangyi [Sat, 10 Feb 2018 06:59:29 +0000 (06:59 +0000)]
bpo-30688: Import unicodedata only when needed. (GH-5606)

Importing unicodedata in sre_parse leads to failure in compilation.
unicodedata is unused during compilation, and is not compiled when this
file is imported. The error occurs when generating posix variables,
pprint is required. The dependency chain goes on like this:

sysconfig -> pprint -> re -> sre_compile -> sre_parse (this file)

This commits fixes compilation issues introduced by
2272cec13b53c405d86c45d404f035f201c0baef.
(Issue 30688, GH-5588)

7 years agobpo-30688: Support \N{name} escapes in re patterns. (GH-5588)
Serhiy Storchaka [Fri, 9 Feb 2018 22:08:17 +0000 (00:08 +0200)]
bpo-30688: Support \N{name} escapes in re patterns. (GH-5588)

Co-authored-by: Jonathan Eunice <jonathan.eunice@gmail.com>
7 years agobpo-30157: Fix csv.Sniffer.sniff() regex pattern. (GH-5601)
Serhiy Storchaka [Fri, 9 Feb 2018 18:00:49 +0000 (20:00 +0200)]
bpo-30157: Fix csv.Sniffer.sniff() regex pattern. (GH-5601)

Co-authored-by: Jake Davis <jcdavis@awedge.net>
7 years agoFix some warnings produced by different compilers. (#5593)
Serhiy Storchaka [Fri, 9 Feb 2018 15:31:26 +0000 (17:31 +0200)]
Fix some warnings produced by different compilers. (#5593)

7 years agoMake formatting of some return codes conforming to the general style. (#5587)
Serhiy Storchaka [Fri, 9 Feb 2018 11:31:19 +0000 (13:31 +0200)]
Make formatting of some return codes conforming to the general style. (#5587)

7 years agobpo-32775: Fix regular expression warnings in fnmatch. (#5583)
Serhiy Storchaka [Fri, 9 Feb 2018 11:30:19 +0000 (13:30 +0200)]
bpo-32775: Fix regular expression warnings in fnmatch. (#5583)

fnmatch.translate() no longer produces patterns which contain set
operations.

Sets starting with '[' or containing '--', '&&', '~~' or '||' will
be interpreted differently in regular expressions in future versions.
Currently they emit warnings. fnmatch.translate() now avoids producing
patterns containing such sets by accident.

7 years agoCleanup inspect
Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) [Fri, 9 Feb 2018 09:59:19 +0000 (15:29 +0530)]
Cleanup inspect

* use isinstance(..)  instead of type(..)
* use  '.. not in ..'  instead of 'not .. in .. '

7 years agobpo-32585: Add tkinter.ttk.Spinbox. (#5221)
Alan D Moore [Fri, 9 Feb 2018 00:03:55 +0000 (18:03 -0600)]
bpo-32585: Add tkinter.ttk.Spinbox. (#5221)

7 years agobpo-32802: Fix Travis build (GH-5589)
Stéphane Wirtel [Thu, 8 Feb 2018 19:14:59 +0000 (20:14 +0100)]
bpo-32802: Fix Travis build (GH-5589)

Fix bug in travis configuration where it did not run the tests when
a change includes both code and doc changes.

7 years agobpo-6135: Fix subprocess.check_output doc to mention changes in 3.6 (GH-5564)
Brice Gros [Wed, 7 Feb 2018 00:46:29 +0000 (01:46 +0100)]
bpo-6135: Fix subprocess.check_output doc to mention changes in 3.6 (GH-5564)

Fixes the documentation for `subprocess.check_output()` not mentioning that the encoding and errors parameters were added in 3.6.

7 years agoFix typo in Include/objimpl.h, the word "has" was missing (GH-5568)
Alexey [Tue, 6 Feb 2018 23:07:30 +0000 (02:07 +0300)]
Fix typo in Include/objimpl.h, the word "has" was missing (GH-5568)

It now reads: ...be aware that Python has no control over...

7 years agobpo-30693: Fix tarfile test cleanup on MSWindows (#5557)
Bernhard M. Wiedemann [Tue, 6 Feb 2018 18:08:53 +0000 (19:08 +0100)]
bpo-30693: Fix tarfile test cleanup on MSWindows (#5557)

it was using our mocked listdir to check when the files were gone.

7 years agobpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560)
Alexey Izbyshev [Tue, 6 Feb 2018 06:09:34 +0000 (09:09 +0300)]
bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560)

Fix a rare but potential pre-exec child process deadlock in subprocess on POSIX systems when marking file descriptors inheritable on exec in the child process.  This bug appears to have been introduced in 3.4 with the inheritable file descriptors support.

This also changes Python/fileutils.c `set_inheritable` to use the "slow" two `fcntl` syscall path instead of the "fast" single `ioctl` syscall path when asked to be async signal safe (by way of being asked not to raise exceptions).  `ioctl` is not a POSIX async-signal-safe approved function.

ref: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html

7 years agoAdd What's new entry for datetime.fromisoformat (#5559)
Paul Ganssle [Tue, 6 Feb 2018 02:28:46 +0000 (21:28 -0500)]
Add What's new entry for datetime.fromisoformat (#5559)

Documents bpo-15873

7 years agobpo-32749: Make dbm.dumb databases more cosistent with other dbm databases. (#5497)
Serhiy Storchaka [Mon, 5 Feb 2018 20:47:31 +0000 (22:47 +0200)]
bpo-32749: Make dbm.dumb databases more cosistent with other dbm databases. (#5497)

7 years agoFix typo in whatsnew/3.7.rst (GH-5551)
Dag Heyman [Mon, 5 Feb 2018 14:39:33 +0000 (15:39 +0100)]
Fix typo in whatsnew/3.7.rst (GH-5551)

now longer -> no longer

7 years agobpo-32720: Fixed the replacement field grammar documentation. (GH-5544)
Mariatta [Mon, 5 Feb 2018 09:29:02 +0000 (04:29 -0500)]
bpo-32720: Fixed the replacement field grammar documentation. (GH-5544)

`arg_name` and `element_index` are defined as `digit`+ instead of `integer`.

7 years agobpo-8722: Document __getattr__ behavior with AttributeError in property (GH-4754)
Cheryl Sabella [Mon, 5 Feb 2018 02:03:22 +0000 (21:03 -0500)]
bpo-8722: Document __getattr__ behavior with AttributeError in property (GH-4754)

When `__getattr__` is implemented, attribute lookup will always fall back to that,
even if the initial failure comes from `__getattribute__` or a descriptor's `__get__`
method (including property methods).

7 years agoAdd entry for uniform lower context; add 'since' to be explicit. (GH-5539)
Terry Jan Reedy [Mon, 5 Feb 2018 00:07:16 +0000 (19:07 -0500)]
Add entry for uniform lower context; add 'since' to be explicit. (GH-5539)

7 years agobpo-32765: Update configdialog General tab create page docstring (GH-5529)
Cheryl Sabella [Sun, 4 Feb 2018 23:15:21 +0000 (18:15 -0500)]
bpo-32765: Update configdialog General tab create page docstring (GH-5529)

Add new entries to the widget list.

7 years agoTry to fix the AppVeyor cache mechanism (GH-5536)
Zachary Ware [Sun, 4 Feb 2018 20:36:43 +0000 (14:36 -0600)]
Try to fix the AppVeyor cache mechanism (GH-5536)

7 years agoFix version in AppVeyor (GH-5535)
Zachary Ware [Sun, 4 Feb 2018 20:09:29 +0000 (14:09 -0600)]
Fix version in AppVeyor (GH-5535)

7 years agoFix typo -- missing "not" (GH-5528)
Raymond Hettinger [Sun, 4 Feb 2018 17:15:01 +0000 (09:15 -0800)]
Fix typo -- missing "not" (GH-5528)

7 years agoUse assertTrue() instead of deprecated assert_(). (#5526)
Serhiy Storchaka [Sun, 4 Feb 2018 16:14:47 +0000 (18:14 +0200)]
Use assertTrue() instead of deprecated assert_(). (#5526)

7 years agobpo-10544: Disallow "yield" in comprehensions and generator expressions. (GH-4564)
Serhiy Storchaka [Sun, 4 Feb 2018 08:53:48 +0000 (10:53 +0200)]
bpo-10544: Disallow "yield" in comprehensions and generator expressions. (GH-4564)

7 years agobpo-32720: Fixed the definition for width and precision in format mini-language doc...
nathankerr96 [Sun, 4 Feb 2018 05:42:08 +0000 (21:42 -0800)]
bpo-32720: Fixed the definition for width and precision in format mini-language doc (GH-5482)

Changed the definition of width and precision from "integer" to "digit+" in format mini-language doc.

7 years agobpo-32746: Fix multiple typos (GH-5144)
Leo Arias [Sun, 4 Feb 2018 00:36:10 +0000 (18:36 -0600)]
bpo-32746: Fix multiple typos (GH-5144)

Fix typos found by codespell in docs, docstrings, and comments.

7 years agobpo-32739: Show default value for rotate() (GH-5485)
Raymond Hettinger [Sat, 3 Feb 2018 16:46:28 +0000 (08:46 -0800)]
bpo-32739: Show default value for rotate() (GH-5485)

7 years agobpo-32691: Use mod_spec.parent when running modules with pdb (GH-5474)
Mario Corchero [Sat, 3 Feb 2018 06:40:11 +0000 (06:40 +0000)]
bpo-32691: Use mod_spec.parent when running modules with pdb (GH-5474)

Previously the module name was used, which broke relative imports when pdb was run against a plain module or submodule.

7 years agobpo-32604: Fix memory leaks in the new _xxsubinterpreters module. (#5507)
Eric Snow [Sat, 3 Feb 2018 04:49:49 +0000 (21:49 -0700)]
bpo-32604: Fix memory leaks in the new _xxsubinterpreters module. (#5507)

7 years agobpo-32734: Fix asyncio.Lock multiple acquire safety issue (GH-5466)
Bar Harel [Fri, 2 Feb 2018 22:04:00 +0000 (00:04 +0200)]
bpo-32734: Fix asyncio.Lock multiple acquire safety issue (GH-5466)

7 years agobpo-32614: Modify re examples to use a raw string to prevent warning (GH-5265)
Cheryl Sabella [Fri, 2 Feb 2018 21:16:27 +0000 (16:16 -0500)]
bpo-32614: Modify re examples to use a raw string to prevent warning (GH-5265)

Modify RE examples in documentation to use raw strings to prevent DeprecationWarning.
Add text to REGEX HOWTO to highlight the deprecation.  Approved by Serhiy Storchaka.

7 years agobpo-32303 - Consistency fixes for namespace loaders (#5481)
Barry Warsaw [Fri, 2 Feb 2018 20:15:58 +0000 (15:15 -0500)]
bpo-32303 - Consistency fixes for namespace loaders (#5481)

* Make sure ``__spec__.loader`` matches ``__loader__`` for namespace packages.
* Make sure ``__spec__.origin` matches ``__file__`` for namespace packages.

https://bugs.python.org/issue32303
https://bugs.python.org/issue32305

7 years agoRevert "bpo-31356: Add context manager to temporarily disable GC GH-5495
Yury Selivanov [Fri, 2 Feb 2018 14:31:06 +0000 (09:31 -0500)]
Revert "bpo-31356: Add context manager to temporarily disable GC GH-5495

This reverts commit 72a0d218dcc94a3cc409a9ef32dfcd5a7bbcb43c.

The reverted commit had a few issues so it was unanimously decided
to undo it. See the bpo issue for details.

7 years agobpo-32747: Remove trailing spaces in docstrings. (GH-5491)
oldk [Fri, 2 Feb 2018 08:52:55 +0000 (16:52 +0800)]
bpo-32747: Remove trailing spaces in docstrings. (GH-5491)

7 years agobpo-32733: Make test_coroutines robust against -Werror (GH-5487)
Nathaniel J. Smith [Fri, 2 Feb 2018 04:55:55 +0000 (20:55 -0800)]
bpo-32733: Make test_coroutines robust against -Werror (GH-5487)

7 years agobpo-32674: Improve the docstring for __import__ (GH-5339)
oldk [Fri, 2 Feb 2018 04:20:00 +0000 (12:20 +0800)]
bpo-32674: Improve the docstring for __import__ (GH-5339)

Clarify that the level argument is used to determine whether to
perform absolute or relative imports: 0 is absolute, while a positive number
is the number of parent directories to search relative to the current module.

7 years agobpo-32436: Fix compiler warning (#5483)
Yury Selivanov [Fri, 2 Feb 2018 03:24:56 +0000 (22:24 -0500)]
bpo-32436: Fix compiler warning (#5483)

7 years agoFix typo in hamt.c comments (#5478)
Dmitry Alimov [Fri, 2 Feb 2018 02:59:48 +0000 (05:59 +0300)]
Fix typo in hamt.c comments (#5478)

7 years agoImplement TimerHandle.when() (#5473)
Andrew Svetlov [Thu, 1 Feb 2018 17:59:32 +0000 (19:59 +0200)]
Implement TimerHandle.when() (#5473)

7 years agobpo-32711: Fix warnings for Python/ast_unparse.c (#5426)
Stéphane Wirtel [Thu, 1 Feb 2018 16:59:27 +0000 (17:59 +0100)]
bpo-32711: Fix warnings for Python/ast_unparse.c (#5426)

* bpo-32711: Fix warnings for Python/ast_unparse.c

7 years ago[3.8] bpo-31508: Remove support of arguments in tkinter.ttk.Treeview.selection. ...
Serhiy Storchaka [Thu, 1 Feb 2018 16:49:21 +0000 (18:49 +0200)]
[3.8] bpo-31508: Remove support of arguments in tkinter.ttk.Treeview.selection. (GH-3651)

It was deprecated in 3.6.

7 years agobpo-32565: Add missed versionadded directives for all new opcodes. (#5199)
Serhiy Storchaka [Thu, 1 Feb 2018 11:48:33 +0000 (13:48 +0200)]
bpo-32565: Add missed versionadded directives for all new opcodes. (#5199)

7 years agobpo-32722: Remove useless example in the Classes tutorial (#5446)
Stéphane Wirtel [Thu, 1 Feb 2018 07:31:07 +0000 (08:31 +0100)]
bpo-32722: Remove useless example in the Classes tutorial (#5446)

In the tutorial about the Generator expression, there is an example with
a dict comprehension and not with a generator expression, just removed
the code.

7 years agoUpdate Doc build to 3.8
Ned Deily [Wed, 31 Jan 2018 23:12:38 +0000 (18:12 -0500)]
Update Doc build to 3.8

7 years agoStart of 3.8.0a0
Ned Deily [Wed, 31 Jan 2018 22:44:09 +0000 (17:44 -0500)]
Start of 3.8.0a0

7 years agoUpdate NEWS, docs, and patchlevel for 3.7.0b1
Ned Deily [Tue, 30 Jan 2018 23:48:26 +0000 (18:48 -0500)]
Update NEWS, docs, and patchlevel for 3.7.0b1

7 years agobpo-32726: Build macOS 10.9+ installer with private copy of Tcl/Tk 8.6
Ned Deily [Tue, 30 Jan 2018 22:29:53 +0000 (17:29 -0500)]
bpo-32726: Build macOS 10.9+ installer with private copy of Tcl/Tk 8.6

7 years agobpo-32735: Fix typo in f-strings datetime format specifier example (GH-5464)
Cheryl Sabella [Wed, 31 Jan 2018 21:37:51 +0000 (16:37 -0500)]
bpo-32735: Fix typo in f-strings datetime format specifier example (GH-5464)

The f-string example for using datetime format specifier does not match the given output.
Changed the format from %b to %B so it matches the output of "January".

7 years agobpo-25988: Emit a warning when use or import ABCs from 'collections'. (#5460)
Serhiy Storchaka [Wed, 31 Jan 2018 17:19:33 +0000 (19:19 +0200)]
bpo-25988: Emit a warning when use or import ABCs from 'collections'. (#5460)

7 years agoMake site documentation more clear (#5461)
Xiang Zhang [Wed, 31 Jan 2018 15:50:50 +0000 (23:50 +0800)]
Make site documentation more clear (#5461)

Mention only ImportError caused by importing sitecustomize.py/usercustomize.py
themselves will be silently ignored.

7 years agobpo-32583: Fix possible crashing in builtin Unicode decoders (#5325)
Xiang Zhang [Wed, 31 Jan 2018 12:48:05 +0000 (20:48 +0800)]
bpo-32583: Fix possible crashing in builtin Unicode decoders (#5325)

When using customized decode error handlers, it is possible for builtin decoders
to write out-of-bounds and then crash.

7 years agobpo-30693: zip+tarfile: sort directory listing (#2263)
Bernhard M. Wiedemann [Wed, 31 Jan 2018 10:17:10 +0000 (11:17 +0100)]
bpo-30693: zip+tarfile: sort directory listing (#2263)

tarfile and zipfile now sort directory listing to generate tar and zip archives
in a more reproducible way.

See also https://reproducible-builds.org/docs/stable-inputs/ on that topic.

7 years agobpo-32727: smtplib's SMTP.send_message behaves differently with from_addr and to_addr...
Stéphane Wirtel [Wed, 31 Jan 2018 00:02:51 +0000 (01:02 +0100)]
bpo-32727: smtplib's SMTP.send_message behaves differently with from_addr and to_addrs (#5451)

Do not pass the name field in the 'from' address in the SMTP envelope.

7 years agocompare with difflib not diff(1) (GH-5450)
Benjamin Peterson [Tue, 30 Jan 2018 17:03:12 +0000 (09:03 -0800)]
compare with difflib not diff(1) (GH-5450)

7 years agobpo-32726: macOS installer and framework enhancements and changes for 3.7.0 (GH-5448)
Ned Deily [Tue, 30 Jan 2018 12:42:14 +0000 (07:42 -0500)]
bpo-32726: macOS installer and framework enhancements and changes for 3.7.0 (GH-5448)

This issue covers various changes for the macOS installers provided via python.org for 3.7.0.

- Provide a provisional new installer variant for macOS 10.9 and later systems with 64-bit (x86_64) architecture only.  Apple has made it known that future versions of macOS will only fully support 64-bit executables and some other third-party software suppliers have chosen 10.9 as their oldest supported system.

- Support **Tcl/Tk 8.6** with the 10.9 installer variant.

- Upgrade **OpenSSL** to 1.1.0g and **SQLite** to 3.22.0.

- The compiler name used for the interpreter build and for modules built with **Distutils / pip** is now _gcc_ rather than _gcc-4.2_. And extension module builds will no longer try to force use of an old SDK if present.

7 years agobpo-28914: Fix compilation of select on Android (#5447)
Victor Stinner [Tue, 30 Jan 2018 11:18:54 +0000 (12:18 +0100)]
bpo-28914: Fix compilation of select on Android (#5447)

EPOLL_CLOEXEC is not defined on Android.

Co-Authored-By: Wataru Matsumoto <sxsns243@gmail.com>
7 years agobpo-28440: Don't add /Library/Python/3.x/site-packages to sys.path (#5445)
Ned Deily [Tue, 30 Jan 2018 10:14:09 +0000 (05:14 -0500)]
bpo-28440: Don't add /Library/Python/3.x/site-packages to sys.path (#5445)

No longer add /Library/Python/3.x/site-packages, the Apple-supplied
system Python site-packages directory, to sys.path for macOS framework
builds in case Apple ships a version of Python 3. A similar change
was made earlier to Python 2.7 where it was found that the coupling
between the system Python and a user-installed framework Python often
caused confusion or pip install failures.

7 years agobpo-32724: Fix references to commands in Doc/pdb.rst (GH-5444)
Stéphane Wirtel [Tue, 30 Jan 2018 09:34:33 +0000 (10:34 +0100)]
bpo-32724: Fix references to commands in Doc/pdb.rst (GH-5444)

Some commands are specified in the documentation, but there is no direct
references.

7 years agobpo-22908: Add seek and tell functionality to ZipExtFile (GH-4966)
John Jolly [Tue, 30 Jan 2018 08:51:35 +0000 (01:51 -0700)]
bpo-22908: Add seek and tell functionality to ZipExtFile (GH-4966)

This allows for nested zip files, tar files within zip files, zip files within tar files, etc.

Contributed by: John Jolly

7 years agobpo-28134: Ignore proto in unknown socket test (GH-5435)
Christian Heimes [Tue, 30 Jan 2018 07:55:46 +0000 (08:55 +0100)]
bpo-28134: Ignore proto in unknown socket test (GH-5435)

Band-aid for macOS: Some platforms seem to ignore unknown protocols.

Signed-off-by: Christian Heimes <christian@python.org>
7 years agobpo-31961: subprocess now accepts path-like args (GH-4329)
Anders Lorentsen [Tue, 30 Jan 2018 07:27:28 +0000 (08:27 +0100)]
bpo-31961: subprocess now accepts path-like args (GH-4329)

Allow os.PathLike args in subprocess APIs.

7 years agocloses bpo-30117: fix lib2to3 ParserIdempotency test (GH-1242)
Eric Appelt [Tue, 30 Jan 2018 07:13:03 +0000 (01:13 -0600)]
closes bpo-30117: fix lib2to3 ParserIdempotency test (GH-1242)

Fix two (in my opinion) spurious failure conditions in the lib2to3.tests.test_parser.TestParserIdempotency test_parser test.

    Use the same encoding found in the initial file to write a temp file for a diff. This retains the BOM if the encoding was initially utf-8-sig.

    If the file cannot be parsed using the normal grammar, try again with no print statement which should succeed for valid files using future print_function

For case (1), the driver was correctly handling a BOM in a utf-8 file, but then the test was not writing a comparison file using 'utf-8-sig' to diff against, so the BOM got removed. I don't think that is the fault of the parser, and lib2to3 will retain the BOM.

For case (2), lib2to3 pre-detects the use of from __future__ import print_function or allows the user to force this interpretation with a -p flag, and then selects a different grammar with the print statement removed. That makes the test cases unfair to this test as the driver itself doesn't know which grammar to use. As a minimal fix, the test will try using a grammar with the print statement, and if that fails fall back on a grammar without it. A more thorough handling of the idempotency test would to be to parse all files using both grammars and ignore if one of the two failed but otherwise check both. I didn't think this was necessary but can change.

7 years agobpo-32102 Add "capture_output=True" to subprocess.run (GH-5149)
Bo Bayles [Tue, 30 Jan 2018 06:40:39 +0000 (00:40 -0600)]
bpo-32102 Add "capture_output=True" to subprocess.run (GH-5149)

Add "capture_output=True" option to subprocess.run, this is equivalent to
setting stdout=PIPE, stderr=PIPE but is much more readable.

7 years agocloses bpo-32721: do not fail test_hashlib if _md5 isn't available (GH-5441)
Benjamin Peterson [Tue, 30 Jan 2018 06:14:17 +0000 (22:14 -0800)]
closes bpo-32721: do not fail test_hashlib if _md5 isn't available (GH-5441)

7 years agobpo-32681: Fix an uninitialized variable in the C implementation of os.dup2 (GH-5346)
Stéphane Wirtel [Tue, 30 Jan 2018 06:04:36 +0000 (07:04 +0100)]
bpo-32681: Fix an uninitialized variable in the C implementation of os.dup2 (GH-5346)

See https://bugs.python.org/issue32441 for where this was introduced.

7 years agobpo-21417: Add compresslevel= to the zipfile module (GH-5385)
Bo Bayles [Tue, 30 Jan 2018 05:54:07 +0000 (23:54 -0600)]
bpo-21417: Add compresslevel= to the zipfile module (GH-5385)

This allows the compression level to be specified when writing zipfiles
(for the entire file *and* overridden on a per-file basis).

Contributed by Bo Bayles

7 years agobpo-25942: make subprocess more graceful on ^C (GH-5026)
Gregory P. Smith [Tue, 30 Jan 2018 05:27:39 +0000 (21:27 -0800)]
bpo-25942: make subprocess more graceful on ^C (GH-5026)

Do not allow receiving a SIGINT to cause the subprocess module to trigger an
immediate SIGKILL of the child process.  SIGINT is normally sent to all child
processes by the OS at the same time already as was the established normal
behavior in 2.7 and 3.2.  This behavior change was introduced during the fix to https://bugs.python.org/issue12494 and is generally surprising to command line
tool users who expect other tools launched in child processes to get their own
SIGINT and do their own cleanup.

In Python 3.3-3.6 subprocess.call and subprocess.run would immediately
SIGKILL the child process upon receiving a SIGINT (which raises a
KeyboardInterrupt).  We now give the child a small amount of time to
exit gracefully before resorting to a SIGKILL.

This is also the case for subprocess.Popen.__exit__ which would
previously block indefinitely waiting for the child to die.  This was
hidden from many users by virtue of subprocess.call and subprocess.run
sending the signal immediately.

Behavior change: subprocess.Popen.__exit__ will not block indefinitely
when the exiting exception is a KeyboardInterrupt.  This is done for
user friendliness as people expect their ^C to actually happen.  This
could cause occasional orphaned Popen objects when not using `call` or
`run` with a child process that hasn't exited.

Refactoring involved: The Popen.wait method deals with the
KeyboardInterrupt second chance, existing platform specific internals
have been renamed to _wait().
Also fixes comment typos.

7 years agobpo-32604: NULL-terminate kwlist in channel_drop_interpreter(). (gh-5437)
Eric Snow [Tue, 30 Jan 2018 04:04:15 +0000 (21:04 -0700)]
bpo-32604: NULL-terminate kwlist in channel_drop_interpreter(). (gh-5437)

7 years agobpo-32701: Clarify the quotetabs flag in quopri documentation (GH-5401)
Julien Palard [Tue, 30 Jan 2018 03:36:06 +0000 (04:36 +0100)]
bpo-32701: Clarify the quotetabs flag in quopri documentation (GH-5401)

7 years agoreplace dynamic import with 'exec' with importlib.import_module (#5433)
Benjamin Peterson [Tue, 30 Jan 2018 02:03:01 +0000 (18:03 -0800)]
replace dynamic import with 'exec' with importlib.import_module (#5433)

7 years agobpo-32604: Expose the subinterpreters C-API in a "private" stdlib module. (gh-1748)
Eric Snow [Tue, 30 Jan 2018 01:23:44 +0000 (18:23 -0700)]
bpo-32604: Expose the subinterpreters C-API in a "private" stdlib module. (gh-1748)

The module is primarily intended for internal use in the test suite.  Building the module under Windows will come in a follow-up PR.

7 years agobpo-32550. Remove the STORE_ANNOTATION bytecode. (GH-5181)
Mark Shannon [Tue, 30 Jan 2018 00:41:04 +0000 (00:41 +0000)]
bpo-32550. Remove the STORE_ANNOTATION bytecode. (GH-5181)

7 years agobpo-28134: Auto-detect socket values from file descriptor (#1349)
Christian Heimes [Mon, 29 Jan 2018 21:37:58 +0000 (22:37 +0100)]
bpo-28134: Auto-detect socket values from file descriptor (#1349)

Fix socket(fileno=fd) by auto-detecting the socket's family, type,
and proto from the file descriptor. The auto-detection can be overruled
by passing in family, type, and proto explicitly.

Without the fix, all socket except for TCP/IP over IPv4 are basically broken:

>>> s = socket.create_connection(('www.python.org', 443))
>>> s
<socket.socket fd=3, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('2003:58:bc4a:3b00:56ee:75ff:fe47:ca7b', 59730, 0, 0), raddr=('2a04:4e42:1b::223', 443, 0, 0)>
>>> socket.socket(fileno=s.fileno())
<socket.socket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('2003:58:bc4a:3b00::%2550471192', 59730, 0, 2550471192), raddr=('2a04:4e42:1b:0:700c:e70b:ff7f:0%2550471192', 443, 0, 2550471192)>

Signed-off-by: Christian Heimes <christian@python.org>
7 years agobpo-31356: Add context manager to temporarily disable GC (GH-4224)
Pablo Galindo [Mon, 29 Jan 2018 20:37:09 +0000 (20:37 +0000)]
bpo-31356: Add context manager to temporarily disable GC (GH-4224)

7 years agobpo-20104: Fix leaks and errors in new os.posix_spawn (GH-5418)
Pablo Galindo [Mon, 29 Jan 2018 20:34:42 +0000 (20:34 +0000)]
bpo-20104: Fix leaks and errors in new os.posix_spawn (GH-5418)

* Fix memory leaks and error handling in posix spawn
* Improve error handling when destroying the file_actions object
* Py_DECREF the result of PySequence_Fast on error
* Handle uninitialized pid
* Use OSError if file actions fails to initialize
* Move _file_actions to outer scope to avoid undefined behaviour
* Remove HAVE_POSIX_SPAWN define in Modules/posixmodule.c
* Unshadow exception and clean error message

7 years agorename _imp initialization function to follow conventions (#5432)
Benjamin Peterson [Mon, 29 Jan 2018 19:33:57 +0000 (11:33 -0800)]
rename _imp initialization function to follow conventions (#5432)

When the C imp module became _imp in 6f44d66bc491bad5b8d897a68da68e009e27829d, the initialization function should have been renamed from PyInit_imp to PyInit__imp.

7 years agobpo-32703: Fix coroutine resource warning in case where there's an error (GH-5410)
Yury Selivanov [Mon, 29 Jan 2018 19:31:47 +0000 (14:31 -0500)]
bpo-32703: Fix coroutine resource warning in case where there's an error (GH-5410)

The commit removes one unnecessary "if" clause in genobject.c.  That "if" clause was masking un-awaited coroutines warnings just to make writing unittests more convenient.

7 years agobpo-32707: Fix warnings in hamt.c (#5430)
Yury Selivanov [Mon, 29 Jan 2018 18:31:37 +0000 (13:31 -0500)]
bpo-32707: Fix warnings in hamt.c (#5430)

7 years agobpo-27931: Fix email address header parsing error (#5329)
jayyyin [Mon, 29 Jan 2018 18:07:44 +0000 (13:07 -0500)]
bpo-27931: Fix email address header parsing error (#5329)

Correctly handle addresses whose username is an empty quoted string.

7 years agobpo-25988: Deprecate exposing collections.abc in collections GH-5414
Raymond Hettinger [Mon, 29 Jan 2018 16:27:49 +0000 (08:27 -0800)]
bpo-25988: Deprecate exposing collections.abc in collections GH-5414

7 years agoAdd a test for pdb until command in coroutine (#5427)
Andrew Svetlov [Mon, 29 Jan 2018 14:17:45 +0000 (16:17 +0200)]
Add a test for pdb until command in coroutine (#5427)

7 years agobpo-28414: ssl module idna test (#5395)
Christian Heimes [Mon, 29 Jan 2018 13:25:13 +0000 (14:25 +0100)]
bpo-28414: ssl module idna test (#5395)

Add test cases for IDNA 2003 and 2008 host names. IDNA 2003
internationalized host names are working since bpo-31399 has landed. IDNA
2008 deviations are still broken and will be fixed in another patch.

Signed-off-by: Christian Heimes <christian@python.org>
7 years agobpo-31429: Define TLS cipher suite on build time (#3532)
Christian Heimes [Mon, 29 Jan 2018 13:10:18 +0000 (14:10 +0100)]
bpo-31429: Define TLS cipher suite on build time (#3532)

Until now Python used a hard coded white list of default TLS cipher
suites. The old approach has multiple downsides. OpenSSL's default
selection was completely overruled. Python did neither benefit from new
cipher suites (ChaCha20, TLS 1.3 suites) nor blacklisted cipher suites.
For example we used to re-enable 3DES.

Python now defaults to OpenSSL DEFAULT cipher suite selection and black
lists all unwanted ciphers. Downstream vendors can override the default
cipher list with --with-ssl-default-suites.

Signed-off-by: Christian Heimes <christian@python.org>
7 years agobpo-20891: Reenable test_embed.test_bpo20891() (GH-5420)
Victor Stinner [Mon, 29 Jan 2018 13:04:44 +0000 (14:04 +0100)]
bpo-20891: Reenable test_embed.test_bpo20891() (GH-5420)

7 years agobpo-28685: Fix compiler warning (GH-5423)
Victor Stinner [Mon, 29 Jan 2018 12:47:06 +0000 (13:47 +0100)]
bpo-28685: Fix compiler warning (GH-5423)

7 years agobpo-32706: Skip test_ftplib.test_check_hostname() (#5422)
Victor Stinner [Mon, 29 Jan 2018 12:21:34 +0000 (13:21 +0100)]
bpo-32706: Skip test_ftplib.test_check_hostname() (#5422)

This test is unstable and currently prevents to make any new change
since the test always fails on Travis CI.

Skip the test to get more time to fix it.

7 years agobpo-31233, bpo-31151: Document socketserver changes (#5417)
Victor Stinner [Mon, 29 Jan 2018 11:10:22 +0000 (12:10 +0100)]
bpo-31233, bpo-31151: Document socketserver changes (#5417)

socketserver.ForkingMixIn.server_close() and
socketserver.ThreadingMixIn.server_close() now waits until all child
processes and non-daemonic threads complete.

7 years agobpo-20891: Py_Initialize() now creates the GIL (#4700)
Victor Stinner [Mon, 29 Jan 2018 10:57:45 +0000 (11:57 +0100)]
bpo-20891: Py_Initialize() now creates the GIL (#4700)

The GIL is no longer created "on demand" to fix a race condition when
PyGILState_Ensure() is called in a non-Python thread.

7 years agobpo-32705: Current Android does not have posix_spawn (#5413)
Chih-Hsuan Yen [Mon, 29 Jan 2018 09:50:35 +0000 (17:50 +0800)]
bpo-32705: Current Android does not have posix_spawn (#5413)

7 years agoFix minor markup typo (#5407)
cocoatomo [Mon, 29 Jan 2018 08:30:48 +0000 (17:30 +0900)]
Fix minor markup typo (#5407)

7 years agobpo-32591: silence deprecation warnings in test_coroutine (GH-5412)
Nathaniel J. Smith [Mon, 29 Jan 2018 07:34:26 +0000 (23:34 -0800)]
bpo-32591: silence deprecation warnings in test_coroutine (GH-5412)

7 years agobpo-23749: Make start-tls tests more stable on win7 buildbot (GH-5409)
Yury Selivanov [Mon, 29 Jan 2018 05:25:05 +0000 (00:25 -0500)]
bpo-23749: Make start-tls tests more stable on win7 buildbot (GH-5409)

To mitigate the situation when the buildbot is under load
and is unable to send/receive data fast enough:

* reduce the size of the payload
* set a generous timeout for socket ops

7 years agobpo-32251: Fix docs (#5408)
Yury Selivanov [Mon, 29 Jan 2018 04:51:08 +0000 (23:51 -0500)]
bpo-32251: Fix docs (#5408)

7 years agobpo-32650: Add an asyncgen pdb test (#5406)
Yury Selivanov [Mon, 29 Jan 2018 03:43:46 +0000 (22:43 -0500)]
bpo-32650: Add an asyncgen pdb test (#5406)

7 years agobpo-32688: Make why the line is commented out clear (GH-5405)
Xiang Zhang [Mon, 29 Jan 2018 03:32:12 +0000 (11:32 +0800)]
bpo-32688: Make why the line is commented out clear (GH-5405)