]> granicus.if.org Git - python/log
python
6 years agobpo-32860: Fix a missing asterisk in the documentation for glob.iglob() (GH-5712)
Miss Islington (bot) [Sat, 17 Feb 2018 03:51:09 +0000 (19:51 -0800)]
bpo-32860: Fix a missing asterisk in the documentation for glob.iglob() (GH-5712)

(cherry picked from commit 6887d86e9a04b9c5718b08e5d9e1ca3cc1f53721)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
6 years agobpo-32604: Clean up created subinterpreters before runtime finalization. (gh-5710)
Miss Islington (bot) [Sat, 17 Feb 2018 02:15:24 +0000 (18:15 -0800)]
bpo-32604: Clean up created subinterpreters before runtime finalization. (gh-5710)

(cherry picked from commit 4c6955e2b0ccf88c705f8d1fac685a8e65f9699e)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
6 years agoCorrect the code example in Python 3.7's What's New (GH-5696)
Miss Islington (bot) [Fri, 16 Feb 2018 18:28:18 +0000 (10:28 -0800)]
Correct the code example in Python 3.7's What's New (GH-5696)

There was an extra dash in the example for re.sub().
(cherry picked from commit b65cb163d6e125606070c54dc757f421fe419b59)

Co-authored-by: xpvpc <32843902+xpvpc@users.noreply.github.com>
6 years agobpo-32436: Add docs for contextvars (GH-5685)
Miss Islington (bot) [Fri, 16 Feb 2018 17:03:18 +0000 (09:03 -0800)]
bpo-32436: Add docs for contextvars (GH-5685)

(cherry picked from commit bd093355a6aaf2f4ca3ed153e195da57870a55eb)

Co-authored-by: Yury Selivanov <yury@magic.io>
6 years agoUpdate and sync importlib.resources documentation (GH-5694) (#5697)
Miss Islington (bot) [Fri, 16 Feb 2018 16:07:53 +0000 (08:07 -0800)]
Update and sync importlib.resources documentation (GH-5694) (#5697)

(cherry picked from commit 997b8c140e768c849fa99d172245a7688af20a89)

Co-authored-by: Barry Warsaw <barry@python.org>
7 years agoUpdate comment in posixmodule.c (GH-5681)
Miss Islington (bot) [Wed, 14 Feb 2018 21:06:46 +0000 (13:06 -0800)]
Update comment in posixmodule.c (GH-5681)

A closing parentheses was missing.

Signed-off-by: Ngie Cooper <yaneurabeya@gmail.com>
(cherry picked from commit 7745ec4e356ac1f4eaf43b155f4482c20a907d48)

Co-authored-by: ngie-eign <1574099+ngie-eign@users.noreply.github.com>
7 years agobpo-32841: Fix cancellation in awaiting asyncio.Condition (GH-5665)
Miss Islington (bot) [Wed, 14 Feb 2018 09:47:30 +0000 (01:47 -0800)]
bpo-32841: Fix cancellation in awaiting asyncio.Condition (GH-5665)

(cherry picked from commit 5746510b7aef423fa4afc92b2abb919307b1dbb9)

Co-authored-by: Bar Harel <bzvi7919@gmail.com>
7 years agoFix installation instructions for *nix (GH-5605)
Miss Islington (bot) [Wed, 14 Feb 2018 03:53:31 +0000 (19:53 -0800)]
Fix installation instructions for *nix (GH-5605)

Remove pkg_add -r python from FreeBSD installation section.
Moved to OpenBSD.
(cherry picked from commit 3384d38d51a2c3450e742175db5d6d638fa5d2eb)

Co-authored-by: Eitan Adler <grimreaper@users.noreply.github.com>
7 years agoremove mercurial dot files (GH-5558)
Miss Islington (bot) [Wed, 14 Feb 2018 02:49:56 +0000 (18:49 -0800)]
remove mercurial dot files (GH-5558)

(cherry picked from commit 2b86f4cb2cd339f545804a9abb8c4d4cc28d9488)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
7 years agobpo-27846: Delete incorrect note in base64 docs (GH-5666)
Miss Islington (bot) [Wed, 14 Feb 2018 00:48:00 +0000 (16:48 -0800)]
bpo-27846: Delete incorrect note in base64 docs (GH-5666)

This note incorrectly stated that "Base64 has an expansion factor of 6
to 4" (it is actually 4 to 3). It was decided to remove the note.

(cherry picked from commit 88c38a4049ded0e1f197fec3e76be7c0c0e83d7a)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
7 years agobpo-31787: Skip refleak check when _hashlib is not available (GH-5660)
Miss Islington (bot) [Tue, 13 Feb 2018 15:07:34 +0000 (07:07 -0800)]
bpo-31787: Skip refleak check when _hashlib is not available (GH-5660)

(cherry picked from commit f0bc645dfede8118c84844bad319cd952c4d1905)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
7 years agobpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995)
Miss Islington (bot) [Tue, 13 Feb 2018 11:32:18 +0000 (03:32 -0800)]
bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995)

(cherry picked from commit d019bc8319ea35e93bf4baa38098ff1b57cd3ee5)

Co-authored-by: Oren Milman <orenmn@gmail.com>
7 years agobpo-32370: Use the correct encoding for ipconfig output in the uuid module. (GH-5608)
Miss Islington (bot) [Tue, 13 Feb 2018 08:58:28 +0000 (00:58 -0800)]
bpo-32370: Use the correct encoding for ipconfig output in the uuid module. (GH-5608)

(cherry picked from commit da6c3da6c33c6bf794f741e348b9c6d86cc43ec5)

Co-authored-by: Segev Finer <segev208@gmail.com>
7 years agobpo-30579: Docs for dynamic traceback creation (GH-5653)
Miss Islington (bot) [Tue, 13 Feb 2018 08:53:37 +0000 (00:53 -0800)]
bpo-30579: Docs for dynamic traceback creation (GH-5653)

(cherry picked from commit aec7532ed3ccbd29d3429a3f375e25f956c44003)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
7 years agobpo-32827: Fix usage of _PyUnicodeWriter_Prepare() in decoding errors handler. (GH...
Miss Islington (bot) [Tue, 13 Feb 2018 07:15:57 +0000 (23:15 -0800)]
bpo-32827: Fix usage of _PyUnicodeWriter_Prepare() in decoding errors handler. (GH-5636) (GH-5650)

(cherry picked from commit b7e2d67f7c035f09c921ca4e7a36529cd502ccf7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
7 years agobpo-32837: IDLE - require encoding argument for textview.view_file. (GH-5646)
Miss Islington (bot) [Mon, 12 Feb 2018 23:15:01 +0000 (15:15 -0800)]
bpo-32837: IDLE - require encoding argument for textview.view_file. (GH-5646)

Using the system and place-dependent default encoding for open()
is a bad idea for IDLE's system and location-independent files.
(cherry picked from commit 688722cedd6437910ff185ecf94fb3b749ad37f2)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
7 years agobpo-29248: Fix os.readlink() on Windows (GH-5577)
Miss Islington (bot) [Mon, 12 Feb 2018 21:39:42 +0000 (13:39 -0800)]
bpo-29248: Fix os.readlink() on Windows (GH-5577)

The PrintNameOffset field of the reparse data buffer
was treated as a number of characters instead of bytes.
(cherry picked from commit 3c34aad4e7a95913ec7db8e5e948a8fc69047bf7)

Co-authored-by: SSE4 <tomskside@gmail.com>
7 years agobpo-32826: Add "encoding=utf-8" to open() in idle_test/test_help_about. (GH-5639)
Miss Islington (bot) [Mon, 12 Feb 2018 20:34:52 +0000 (12:34 -0800)]
bpo-32826: Add "encoding=utf-8" to open() in idle_test/test_help_about. (GH-5639)

GUI test test_file_buttons() only looks at initial ascii-only lines,
but failed on systems where open() defaults to 'ascii' because
readline() internally reads and decodes far enough ahead to encounter
a non-ascii character in CREDITS.txt.
(cherry picked from commit f34e03ec0ea6a4cef8d966087c77e616c4a5893b)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
7 years agobpo-32221: makeipaddr(): remove interface part + speedup (GH-5449) (GH-5449) (#5641)
Miss Islington (bot) [Mon, 12 Feb 2018 20:12:24 +0000 (12:12 -0800)]
bpo-32221: makeipaddr(): remove interface part + speedup (GH-5449) (GH-5449) (#5641)

(cherry picked from commit 7766b96ab80b04509bbac708ee5ecf3c1c5934fc)

Co-authored-by: Коренберг Марк <socketpair@gmail.com>
7 years agoFix typo in Include/objimpl.h, the word "has" was missing (GH-5568) (GH-5569)
Miss Islington (bot) [Mon, 12 Feb 2018 07:33:11 +0000 (23:33 -0800)]
Fix typo in Include/objimpl.h, the word "has" was missing (GH-5568) (GH-5569)

It now reads: ...be aware that Python has no control over...
(cherry picked from commit 517da1e58f4c489d4b31579852cde5f7113da08e)

Co-authored-by: Alexey <forestbiiird@gmail.com>
7 years agobpo-32815: Improve docs on the subprocess API *text* parameter (GH-5622) (GH-5631)
Miss Islington (bot) [Sun, 11 Feb 2018 23:21:02 +0000 (15:21 -0800)]
bpo-32815: Improve docs on the subprocess API *text* parameter (GH-5622) (GH-5631)

Describe *text* as an alias for *universal_newlines* in more places that people are likely to be referred to.
(cherry picked from commit e14c01037877768a3fe766e50d14993bd5d8a67e)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
7 years agoFix AppVeyor doc short-circuit (GH-5633)
Miss Islington (bot) [Sun, 11 Feb 2018 22:14:45 +0000 (14:14 -0800)]
Fix AppVeyor doc short-circuit (GH-5633)

(cherry picked from commit 6ea20fc719dcaf102d2cefa1786f0421514f7a58)

7 years ago[3.7] Add short-circuit for doc changes to AppVeyor (GH-5626)
Zachary Ware [Sun, 11 Feb 2018 17:55:32 +0000 (11:55 -0600)]
[3.7] Add short-circuit for doc changes to AppVeyor (GH-5626)

(cherry picked from commit 28607e0dd9417ce44a109980ffd60697c1afdea0)

7 years agobpo-32604: Make _xxsubinterpreters build on Windows (GH-5624)
Miss Islington (bot) [Sun, 11 Feb 2018 17:16:04 +0000 (09:16 -0800)]
bpo-32604: Make _xxsubinterpreters build on Windows (GH-5624)

This is not the ideal solution; this means that a test module is now
always included in the main python3x.dll.  However, we're already
including xxsubtype, so why not?
(cherry picked from commit 310b05289b5d9550040f469e60b5e8e77f1022b6)

Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
7 years agobpo-11015: Update test.support documentation (GH-5619)
Miss Islington (bot) [Sun, 11 Feb 2018 16:34:28 +0000 (08:34 -0800)]
bpo-11015: Update test.support documentation (GH-5619)

(cherry picked from commit 988fb28431d3a3fc5dc6eb657c8a4baacc04d9ce)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
7 years agobpo-32792: Preserve mapping order in ChainMap() (GH-5586) (#GH-5617)
Miss Islington (bot) [Sun, 11 Feb 2018 09:09:52 +0000 (01:09 -0800)]
bpo-32792: Preserve mapping order in ChainMap() (GH-5586) (#GH-5617)

(cherry picked from commit 3793f95f98c3112ce447288a5bf9899eb9e35423)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
7 years agobpo-32800: Update link to w3c doc for xml default namespaces (GH-5609) (GH-5611)
Miss Islington (bot) [Sat, 10 Feb 2018 23:08:34 +0000 (15:08 -0800)]
bpo-32800: Update link to w3c doc for xml default namespaces (GH-5609) (GH-5611)

The new link is given in a red box on the old page.
(cherry picked from commit 8d1f2f40389c476d9240ec87a33da0373597c6af)

Co-authored-by: sblondon <sblondon@users.noreply.github.com>
7 years agotravis: Use -O3 option (GH-5599)
Miss Islington (bot) [Sat, 10 Feb 2018 11:56:22 +0000 (03:56 -0800)]
travis: Use -O3 option (GH-5599)

We don't use debugger on Travis.
(cherry picked from commit 8ff53564730f7ba503f5ad94418c309c48e8516d)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
7 years agobpo-30157: Fix csv.Sniffer.sniff() regex pattern. (GH-5601) (GH-5602)
Miss Islington (bot) [Fri, 9 Feb 2018 22:00:48 +0000 (14:00 -0800)]
bpo-30157: Fix csv.Sniffer.sniff() regex pattern. (GH-5601) (GH-5602)

Co-authored-by: Jake Davis <jcdavis@awedge.net>
(cherry picked from commit 2411292ba8155327125d8a1da8a4c9fa003d5909)

7 years agoFix some warnings produced by different compilers. (GH-5593) (GH-5600)
Miss Islington (bot) [Fri, 9 Feb 2018 15:56:34 +0000 (07:56 -0800)]
Fix some warnings produced by different compilers. (GH-5593) (GH-5600)

(cherry picked from commit bfe4fd5f2e96e72eecb5b8a0c7df0ac1689f3b7e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
7 years agoMake formatting of some return codes conforming to the general style. (GH-5587) ...
Miss Islington (bot) [Fri, 9 Feb 2018 12:08:04 +0000 (04:08 -0800)]
Make formatting of some return codes conforming to the general style. (GH-5587) (GH-5597)

(cherry picked from commit 5bb0005f9ff768ac443924b4bb26c3818ce8dc5a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
7 years agobpo-32775: Fix regular expression warnings in fnmatch. (GH-5583) (GH-5596)
Miss Islington (bot) [Fri, 9 Feb 2018 11:56:50 +0000 (03:56 -0800)]
bpo-32775: Fix regular expression warnings in fnmatch. (GH-5583) (GH-5596)

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.
(cherry picked from commit 23cdbfa744f0ec0e9e7575d378df4cb758691cd3)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
7 years agobpo-32585: Add tkinter.ttk.Spinbox. (GH-5221) (GH-5592)
Miss Islington (bot) [Fri, 9 Feb 2018 11:40:14 +0000 (03:40 -0800)]
bpo-32585: Add tkinter.ttk.Spinbox. (GH-5221) (GH-5592)

(cherry picked from commit a48e78a0b7761dd74f1d03fc69e0f6caa6f02fe6)

Co-authored-by: Alan D Moore <me@alandmoore.com>
7 years agobpo-32802: Fix Travis build (GH-5589) (GH-5590)
Miss Islington (bot) [Thu, 8 Feb 2018 19:42:47 +0000 (11:42 -0800)]
bpo-32802: Fix Travis build (GH-5589) (GH-5590)

Fix bug in travis configuration where it did not run the tests when
a change includes both code and doc changes.
(cherry picked from commit 32921f90821ab54ffb757b7e996e5b7a71fac25e)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
7 years agobpo-32720: Fixed the replacement field grammar documentation. (GH-5544) (GH-5546)
Miss Islington (bot) [Wed, 7 Feb 2018 01:14:20 +0000 (17:14 -0800)]
bpo-32720: Fixed the replacement field grammar documentation. (GH-5544) (GH-5546)

`arg_name` and `element_index` are defined as `digit`+ instead of `integer`.
(cherry picked from commit 7a561afd2c79f63a6008843b83733911d07f0119)

Co-authored-by: Mariatta <Mariatta@users.noreply.github.com>
7 years agoFix typo in whatsnew/3.7.rst (GH-5551) (GH-5553)
Miss Islington (bot) [Wed, 7 Feb 2018 01:13:47 +0000 (17:13 -0800)]
Fix typo in whatsnew/3.7.rst (GH-5551) (GH-5553)

now longer -> no longer
(cherry picked from commit c309bcfb9fb295e70a235c461d9edcaa54c821d0)

Co-authored-by: Dag Heyman <dag@yubico.com>
7 years agobpo-6135: Fix subprocess.check_output doc to mention changes in 3.6 (GH-5564) (GH...
Miss Islington (bot) [Wed, 7 Feb 2018 01:12:06 +0000 (17:12 -0800)]
bpo-6135: Fix subprocess.check_output doc to mention changes in 3.6 (GH-5564) (GH-5572)

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

Co-authored-by: Brice Gros <brice-gros@users.noreply.github.com>
7 years agobpo-30693: Fix tarfile test cleanup on MSWindows (GH-5557) (GH-5567)
Miss Islington (bot) [Tue, 6 Feb 2018 18:33:27 +0000 (10:33 -0800)]
bpo-30693: Fix tarfile test cleanup on MSWindows (GH-5557) (GH-5567)

it was using our mocked listdir to check when the files were gone.
(cherry picked from commit 4ad703b7ca463d1183539277dde90ffb1c808487)

Co-authored-by: Bernhard M. Wiedemann <githubbmw@lsmod.de>
7 years agobpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560) (GH-5562)
Miss Islington (bot) [Tue, 6 Feb 2018 06:31:22 +0000 (22:31 -0800)]
bpo-32777: Fix _Py_set_inheritable async-safety in subprocess (GH-5560) (GH-5562)

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
(cherry picked from commit c1e46e94de38a92f98736af9a42d89c3975a9919)

Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
7 years ago[3.7] bpo-8722: Document __getattr__ behavior with AttributeError in property (GH...
Miss Islington (bot) [Mon, 5 Feb 2018 03:16:49 +0000 (19:16 -0800)]
[3.7] bpo-8722: Document __getattr__ behavior with AttributeError in property (GH-5543)

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).
(cherry picked from commit d1f318105b8781b01f3507d5cb0fd841b977d5f2)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
7 years agobpo-30928: IDLE - update NEWS.txt. (GH-5539) (GH-5540)
Miss Islington (bot) [Mon, 5 Feb 2018 01:18:37 +0000 (17:18 -0800)]
bpo-30928: IDLE - update NEWS.txt. (GH-5539) (GH-5540)

Add entry for uniform lower context; add 'since' to be explicit.
(cherry picked from commit 05e806767b857b1eab838e712828e3a7d57cabf1)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
7 years agobpo-32765: Update configdialog General tab create page docstring (GH-5529) (GH-5537)
Miss Islington (bot) [Sun, 4 Feb 2018 23:39:22 +0000 (15:39 -0800)]
bpo-32765: Update configdialog General tab create page docstring (GH-5529) (GH-5537)

Add new entries to the widget list.
(cherry picked from commit 845d86485e35a26478aedb3dc127d632fdc65759)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
7 years agoFix typo -- missing "not" (GH-5528) (GH-5530)
Miss Islington (bot) [Sun, 4 Feb 2018 18:10:17 +0000 (10:10 -0800)]
Fix typo -- missing "not" (GH-5528) (GH-5530)

7 years agoUse assertTrue() instead of deprecated assert_(). (GH-5526) (GH-5527)
Miss Islington (bot) [Sun, 4 Feb 2018 16:38:56 +0000 (08:38 -0800)]
Use assertTrue() instead of deprecated assert_(). (GH-5526) (GH-5527)

(cherry picked from commit 95c3262762f7d0da97ad633f40bed7cd2df9814c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
7 years ago[3.7] bpo-32691: Use mod_spec.parent when running modules with pdb (GH-5510)
Miss Islington (bot) [Sun, 4 Feb 2018 08:07:16 +0000 (00:07 -0800)]
[3.7] bpo-32691: Use mod_spec.parent when running modules with pdb (GH-5510)

Previously the module name was used, which broke relative imports when pdb was run against a plain module or submodule.
(cherry picked from commit 38bfa8418f5d39bcc7478b8f7aef4a632c26172e)

Co-authored-by: Mario Corchero <mariocj89@gmail.com>
7 years agobpo-32720: Fixed the definition for width and precision in format mini-language doc...
Miss Islington (bot) [Sun, 4 Feb 2018 06:03:21 +0000 (22:03 -0800)]
bpo-32720: Fixed the definition for width and precision in format mini-language doc (GH-5482) (GH-5524)

Changed the definition of width and precision from "integer" to "digit+" in format mini-language doc.
(cherry picked from commit 8b5fa289fdb04b6b919cf95fa99246aa872e47a8)

Co-authored-by: nathankerr96 <nathankerr96@gmail.com>
7 years ago[3.7] bpo-32746: Fix multiple typos (GH-5144) (GH-5520)
Miss Islington (bot) [Sun, 4 Feb 2018 01:41:43 +0000 (17:41 -0800)]
[3.7] bpo-32746: Fix multiple typos (GH-5144) (GH-5520)

Fix typos found by codespell in docs, docstrings, and comments.
(cherry picked from commit c3d9508ff22ece9a96892b628dd5813e2fb0cd80)

Co-authored-by: Leo Arias <leo.arias@canonical.com>
7 years agobpo-32739: Show default value for rotate() (GH-5485) (GH-5514)
Miss Islington (bot) [Sat, 3 Feb 2018 17:08:42 +0000 (09:08 -0800)]
bpo-32739: Show default value for rotate() (GH-5485) (GH-5514)

(cherry picked from commit 589c718a8e3bde017350f248f7f1c009240eb52b)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
7 years agobpo-32604: Fix memory leaks in the new _xxsubinterpreters module. (GH-5507)
Miss Islington (bot) [Sat, 3 Feb 2018 05:38:57 +0000 (21:38 -0800)]
bpo-32604: Fix memory leaks in the new _xxsubinterpreters module. (GH-5507)

(cherry picked from commit 4e9da0d163731caa79811c723c703ee416c31826)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
7 years agobpo-32303 - Consistency fixes for namespace loaders (GH-5481) (#5503)
Barry Warsaw [Sat, 3 Feb 2018 00:49:25 +0000 (19:49 -0500)]
bpo-32303 - Consistency fixes for namespace loaders (GH-5481) (#5503)

* 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
(cherry picked from commit bbbcf8693b876daae4469765aa62f8924f39a7d2)

Co-authored-by: Barry Warsaw <barry@python.org>
7 years agobpo-32734: Fix asyncio.Lock multiple acquire safety issue (GH-5466) (#5501)
Miss Islington (bot) [Fri, 2 Feb 2018 23:14:38 +0000 (15:14 -0800)]
bpo-32734: Fix asyncio.Lock multiple acquire safety issue (GH-5466) (#5501)

(cherry picked from commit 2f79c014931cbb23b08a7d16c534a3cc9607ae14)

Co-authored-by: Bar Harel <bzvi7919@gmail.com>
7 years agobpo-32614: Modify re examples to use a raw string to prevent warning (GH-5265) (...
Miss Islington (bot) [Fri, 2 Feb 2018 21:50:44 +0000 (13:50 -0800)]
bpo-32614: Modify re examples to use a raw string to prevent warning (GH-5265) (#5499)

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.
(cherry picked from commit 66771422d0541289d0b1287bc3c28e8b5609f6b4)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
7 years agoRevert "bpo-31356: Add context manager to temporarily disable GC GH-5495 (#5496)
Miss Islington (bot) [Fri, 2 Feb 2018 15:04:32 +0000 (07:04 -0800)]
Revert "bpo-31356: Add context manager to temporarily disable GC GH-5495 (#5496)

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.
(cherry picked from commit 383b32fe108ea627699cc9c644fba5f8bae95d73)

Co-authored-by: Yury Selivanov <yury@magic.io>
7 years agobpo-32733: Make test_coroutines robust against -Werror (GH-5487) (GH-5490)
Miss Islington (bot) [Fri, 2 Feb 2018 05:57:28 +0000 (21:57 -0800)]
bpo-32733: Make test_coroutines robust against -Werror (GH-5487) (GH-5490)

(cherry picked from commit 2efb9735899c7c642f3e75a121af82b1679577d3)

Co-authored-by: Nathaniel J. Smith <njs@pobox.com>
7 years agobpo-32674: Improve the docstring for __import__ (GH-5339) (GH-5488)
Miss Islington (bot) [Fri, 2 Feb 2018 04:51:36 +0000 (20:51 -0800)]
bpo-32674: Improve the docstring for __import__ (GH-5339) (GH-5488)

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.
(cherry picked from commit 461d225b195eec5269f317323b41115516144c41)

Co-authored-by: oldk <oldk1331@users.noreply.github.com>
7 years agobpo-32436: Fix compiler warning (GH-5483) (GH-5486)
Miss Islington (bot) [Fri, 2 Feb 2018 03:58:19 +0000 (19:58 -0800)]
bpo-32436: Fix compiler warning (GH-5483) (GH-5486)

(cherry picked from commit 55e0839f2672e029c2b96514028c77c31ffbe41f)

Co-authored-by: Yury Selivanov <yury@magic.io>
7 years agoFix typo in hamt.c comments (GH-5478) (#5484)
Miss Islington (bot) [Fri, 2 Feb 2018 03:30:34 +0000 (19:30 -0800)]
Fix typo in hamt.c comments (GH-5478) (#5484)

(cherry picked from commit 01a0cb891694cf73b86f799c48d8c78de1b8f74c)

Co-authored-by: Dmitry Alimov <dvalimov@gmail.com>
7 years agoImplement TimerHandle.when() (GH-5473) (GH-5480)
Miss Islington (bot) [Thu, 1 Feb 2018 19:56:03 +0000 (11:56 -0800)]
Implement TimerHandle.when() (GH-5473) (GH-5480)

(cherry picked from commit 3d4dbd8f019c0bbac99fc9248077044ff1039ca3)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
7 years ago[3.7] bpo-32711: Fix warnings for Python/ast_unparse.c (GH-5426) (#5475)
Miss Islington (bot) [Thu, 1 Feb 2018 17:41:24 +0000 (09:41 -0800)]
[3.7] bpo-32711: Fix warnings for Python/ast_unparse.c (GH-5426) (#5475)

* bpo-32711: Fix warnings for Python/ast_unparse.c
(cherry picked from commit 83ab995871ffd504ac229bdbf5b9e9ffc1032815)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
7 years agobpo-32565: Add missed versionadded directives for all new opcodes. (GH-5199) (GH...
Miss Islington (bot) [Thu, 1 Feb 2018 12:12:55 +0000 (04:12 -0800)]
bpo-32565: Add missed versionadded directives for all new opcodes. (GH-5199) (GH-5470)

(cherry picked from commit 12e7cd8a51956a5ce373aac692ae6366c5f86584)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
7 years agoUpdate Doc build for split off of 3.7 branch
Ned Deily [Wed, 31 Jan 2018 23:24:44 +0000 (18:24 -0500)]
Update Doc build for split off of 3.7 branch

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 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 agofinished 3.7.0b1 - on to b1+
Ned Deily [Wed, 31 Jan 2018 22:00:52 +0000 (17:00 -0500)]
finished 3.7.0b1 - on to b1+

7 years agoUpdate NEWS, docs, and patchlevel for 3.7.0b1 v3.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 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)