Commit Graph

44789 Commits

Author SHA1 Message Date
Miss Islington (bot) f90cbcbfe3
bpo-36528: Remove duplicate re tests. (GH-2689)
Co-Authored-By: Makdon <makdon@makdon.me>
(cherry picked from commit e6557d3c62)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-09-11 09:46:29 -07:00
Miss Islington (bot) 63eefc3567 bpo-37885: venv: Don't produce unbound variable warning on deactivate (GH-15973)
Before, running deactivate from a bash shell configured to treat undefined variables as errors (`set -u`) would produce a warning:

```
$ python3 -m venv test
$ source test/bin/activate
(test) $ deactivate
-bash: $1: unbound variable
```
(cherry picked from commit 5209e586b7)

Co-authored-by: Daniel Abrahamsson <hamsson@gmail.com>
2019-09-11 08:55:57 -07:00
Miss Islington (bot) 20f80bfc83
bpo-36634: Fixes activate.bat when existing values contain double quotes (GH-15924)
(cherry picked from commit 574b324bdc)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-09-11 08:21:58 -07:00
Miss Islington (bot) b4808c1265 closes bpo-37252: Fix devpoll tests. (GH-14017) (GH-15948)
(cherry picked from commit 95da826db9)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2019-09-11 16:37:38 +02:00
Miss Islington (bot) 42edfcfd12 bpo-36919: make test_source_encoding.test_issue2301 implementation-independent (GH-13639) (GH-15952)
* bpo-36919: make test_issue2301 implementation-independent
(cherry picked from commit b6643dcfc2)

Co-authored-by: Pavel Koneski <pavel.koneski@gmail.com>
2019-09-11 15:37:18 +01:00
Miss Islington (bot) b18b19809d
bpo-38107: Replace direct future and task contructor calls with factories in asyncio tests (GH-15928)
(cherry picked from commit 9aee90018a)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-09-11 07:21:53 -07:00
Miss Islington (bot) fef5bdc645 bpo-34519: Add additional aliases for HP Roman 8 (GH-8956) (GH-15945)
* bpo-34519: Add additional aliases for HP Roman 8

HP Roman 8 is known under mode aliases than listed in aliases.py.

Patch by Michael Osipov.
(cherry picked from commit a828514cc3)

Co-authored-by: Michael Osipov <michael.osipov@siemens.com>
2019-09-11 15:13:54 +01:00
Miss Islington (bot) 35d0934040 bpo-37305: add MIME type for Web App Manifest (GH-14199) (#15946)
* bpo-37305: add MIME type for Web App Manifest

Co-authored-by: Filip Š <filip.stamcar@hotmail.com>
2019-09-11 15:13:31 +01:00
Miss Islington (bot) cbd7b2a399 bpo-31163: Added return values to pathlib.Path instance's rename and replace methods. (GH-13582) (GH-15944)
* bpo-31163: Added return values to pathlib.Path instance's rename and replace methods.
(cherry picked from commit 088a09af4b)

Co-authored-by: hui shang <shangdahao@gmail.com>
2019-09-11 15:12:54 +01:00
Vinay Sajip 3b92ddb761
[3.8] bpo-35168: Make shlex.punctuation_chars read-only (GH-11631) (GH-15927)
(cherry picked from commit 972cf5c06a)

Co-authored-by: Alex <a.v.shkop@gmail.com>
2019-09-11 13:39:52 +01:00
Miss Islington (bot) e3bd941e4e
bpo-20504 : in cgi.py, fix bug when a multipart/form-data request has… (GH-10638)
* bpo-20504 : in cgi.py, fix bug when a multipart/form-data request has no content-length header

* Add Misc/NEWS.d/next file.

* Add rst formatting for NEWS.d/next file

* Reaplce assert by self.assertEqual
(cherry picked from commit 2d7cacacc3)

Co-authored-by: Pierre Quentel <pierre.quentel@gmail.com>
2019-09-11 05:09:23 -07:00
Miss Islington (bot) f3e430b079
bpo-35066: Make trailing percent test more portable. (GH-15907)
Different libc implementations have different behavior when presented with trailing % in strftime strings. To make test_strftime_trailing_percent more portable, compare the output of datetime.strftime directly to that of time.strftime rather than hardcoding.
(cherry picked from commit f2173ae38f)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-09-11 04:47:16 -07:00
Brett Cannon 0a6693a469
[3.8] bpo-37409: fix relative import with no parent (GH-14956) (GH-15913)
Relative imports use resolve_name to get the absolute target name,
which first seeks the current module's absolute package name from the globals:
If __package__ (and __spec__.parent) are missing then
import uses __name__, truncating the last segment if
the module is a submodule rather than a package __init__.py
(which it guesses from whether __path__ is defined).

The __name__ attempt should fail if there is no parent package (top level modules),
if __name__ is '__main__' (-m entry points), or both (scripts).
That is, if both __name__ has no subcomponents and the module does not seem
to be a package __init__ module then import should fail..
(cherry picked from commit 92420b3e67)

Co-authored-by: Ben Lewis <benjimin@users.noreply.github.com>
2019-09-11 12:38:22 +01:00
Miss Islington (bot) 57491de7c3
bpo-38081: Fixes ntpath.realpath('NUL') (GH-15899)
(cherry picked from commit 92521fea5d)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-09-11 03:43:30 -07:00
Andrew Svetlov 4601f7a49f
[3.8] bpo-36373: Fix deprecation warnings (GH-15889) (GH-15901)
https://bugs.python.org/issue36373
(cherry picked from commit 7264e92b71)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-09-11 13:40:36 +03:00
Zachary Ware df935b5f0b
[3.8] bpo-37936: Systematically distinguish rooted vs. unrooted in .gitignore (GH-15823) (GH-15900)
A root cause of bpo-37936 is that it's easy to write a .gitignore
rule that's intended to apply to a specific file (e.g., the
`pyconfig.h` generated by `./configure`) but actually applies to all
similarly-named files in the tree (e.g., `PC/pyconfig.h`.)

Specifically, any rule with no non-trailing slashes is applied in an
"unrooted" way, to files anywhere in the tree.  This means that if we
write the rules in the most obvious-looking way, then

 * for specific files we want to ignore that happen to be in
   subdirectories (like `Modules/config.c`), the rule will work
   as intended, staying "rooted" to the top of the tree; but

 * when a specific file we want to ignore happens to be at the root of
   the repo (like `platform`), then the obvious rule (`platform`) will
   apply much more broadly than intended: if someone tries to add a
   file or directory named `platform` somewhere else in the tree, it
   will unexpectedly get ignored.

That's surprising behavior that can make the .gitignore file's
behavior feel finicky and unpredictable.

To avoid it, we can simply always give a rule "rooted" behavior when
that's what's intended, by systematically using leading slashes.

Further, to help make the pattern obvious when looking at the file and
minimize any need for thinking about the syntax when adding new rules:
separate the rules into one group for each type, with brief comments
identifying them.

For most of these rules it's clear whether they're meant to be rooted
or unrooted, but in a handful of cases I've only guessed.  In that
case the safer default (the choice that won't hide information) is the
narrower, rooted meaning, with a leading slash.  If for some of these
the unrooted meaning is desired after all, it'll be easy to move them
to the unrooted section at the top.

(cherry picked from commit 455122a009)

Co-authored-by: Greg Price <gnprice@gmail.com>
2019-09-11 11:31:12 +01:00
Miss Islington (bot) 872c85a179
bpo-37424: Avoid a hang in subprocess.run timeout output capture (GH-14490)
Fixes a possible hang when using a timeout on subprocess.run() while
capturing output. If the child process spawned its own children or otherwise
connected its stdout or stderr handles with another process, we could hang
after the timeout was reached and our child was killed when attempting to read
final output from the pipes.
(cherry picked from commit 580d2782f7)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2019-09-11 03:05:14 -07:00
Miss Islington (bot) 74b0291b03
bpo-28494: Test existing zipfile working behavior. (GH-15853)
Add unittests for executables with a zipfile appended to test_zipfile, as zipfile.is_zipfile and zipfile.ZipFile work properly on these today.
(cherry picked from commit 3f4db4a0ba)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2019-09-10 15:57:54 -07:00
Victor Stinner d42a4fdc63
bpo-37531: Enhance regrtest multiprocess timeout (GH-15345) (GH-15871)
* Write a message when killing a worker process
* Put a timeout on the second popen.communicate() call
  (after killing the process)
* Put a timeout on popen.wait() call
* Catch popen.kill() and popen.wait() exceptions

(cherry picked from commit de2d9eed8b)
2019-09-10 17:54:51 +02:00
Jason R. Coombs 97c2f68a4c
[3.8] bpo-38086: Sync importlib.metadata with importlib_metadata 0.21. (GH-15840) (#15861)
https://gitlab.com/python-devs/importlib_metadata/-/tags/0.21.
(cherry picked from commit 17499d8270)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2019-09-10 15:58:29 +01:00
Miss Islington (bot) 41c965f930
Fix subprocess docstring typo (GH-15812)
(cherry picked from commit 182e1d1f84)

Co-authored-by: Matthias <xmatthias@outlook.com>
2019-09-10 07:51:29 -07:00
Miss Islington (bot) 2ed0ac6bf1 bpo-38088: Fixes distutils not finding vcruntime140.dll with only v142 toolset installed (GH-15849)
(cherry picked from commit cd8221152d)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-09-10 15:42:26 +01:00
Steve Dower 206e4c3d35
bpo-38087: Fix case sensitivity in test_pathlib and test_ntpath (GH-15850) 2019-09-10 15:29:28 +01:00
Miss Islington (bot) f12ff05bc0
bpo-38066: Hide internal Stream methods (GH-15762)
feed_eof(), feed_data(), set_exception(), and set_transport() are prefixed with underscore now.

https://bugs.python.org/issue38066
(cherry picked from commit 12c122ae95)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-09-10 06:44:32 -07:00
Miss Islington (bot) c43f26eca3
closes bpo-25461: Update os.walk() docstring to match the online docs. (GH-11836)
(cherry picked from commit 734f1202a5)

Co-authored-by: Bernt Røskar Brenna <bernt.brenna@gmail.com>
2019-09-10 06:21:57 -07:00
Miss Islington (bot) c3008dd480
bpo-37251: Removes __code__ check from _is_async_obj. (GH-15830)
(cherry picked from commit f1a297acb6)

Co-authored-by: Lisa Roach <lisaroach14@gmail.com>
2019-09-10 06:16:00 -07:00
Miss Islington (bot) eaa1b09412
docs: Add references to AsyncMock in unittest.mock.patch (GH-13681)
Update the docs as patch can now return an AsyncMock if the patched
object is an async function.
(cherry picked from commit f5e7f39d29)

Co-authored-by: Mario Corchero <mcorcherojim@bloomberg.net>
2019-09-10 06:15:19 -07:00
Miss Islington (bot) eb1bc48c74 bpo-37619: update_one_slot() should not ignore wrapper descriptors for wrong type (GH-15838)
(cherry picked from commit 57ea335606)

Co-authored-by: Jeroen Demeyer <J.Demeyer@UGent.be>
2019-09-10 05:55:12 -07:00
Miss Islington (bot) 55daf1a561
bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [queue] (GH-13950)
This PR deprecate explicit loop parameters in all public asyncio APIs

This issues is split to be easier to review.

fourth step: queue.py

https://bugs.python.org/issue36373
(cherry picked from commit 9008be303a)

Co-authored-by: Emmanuel Arias <emmanuelarias30@gmail.com>
2019-09-10 05:50:14 -07:00
Miss Islington (bot) bb8fc8bd30
bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [locks] (GH-13920)
This PR deprecate explicit loop parameters in all public asyncio APIs

This issues is split to be easier to review.

Third step: locks.py

https://bugs.python.org/issue36373
(cherry picked from commit 537877d85d)

Co-authored-by: Emmanuel Arias <emmanuelarias30@gmail.com>
2019-09-10 04:26:54 -07:00
Steve Dower fdd17abc51
bpo-35941: Fix performance regression in SSL certificate code (GH-12610)
Accumulate certificates in a set instead of doing a costly list contain
operation. A Windows cert store can easily contain over hundred
certificates. The old code would result in way over 5,000 comparison
operations

Signed-off-by: Christian Heimes <christian@python.org>
2019-09-10 02:02:04 -07:00
Miss Islington (bot) 29bde48ade
bpo-38077: IDLE no longer adds 'argv' to the user namespace (GH-15818)
This only happened when initializing the subprocess to run a module.
This recent bug only affected 3.7.4 and 3.8.0b2 to 3.8.0b4.
(cherry picked from commit c59295a1ca)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-09-09 20:29:01 -07:00
Miss Islington (bot) 421ef39968
Fix punctuation in `os.execvpe` docstring. (GH-15051)
(cherry picked from commit fb6807b043)

Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
2019-09-09 10:44:46 -07:00
Miss Islington (bot) eadf6b8787
bpo-35803: Document and test dir=PathLike for tempfile (GH-11644)
Co-Authored-By: Ammar Askar <ammar_askar@hotmail.com>
(cherry picked from commit 370138ba9c)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2019-09-09 10:31:31 -07:00
Miss Islington (bot) 0468a85cc4
Clarify that shutil's copy functions can accept path-like values (GH-15141)
(cherry picked from commit 9488a5289d)

Co-authored-by: Boris Verhovsky <boris.verk@gmail.com>
2019-09-09 10:18:51 -07:00
Steve Dower 2d5594fac2
bpo-20490: Improve circular import error message (GH-15308) 2019-09-09 09:45:18 -07:00
Miss Islington (bot) 78d15faf6c
bpo-38006: Avoid closure in weakref.WeakValueDictionary (GH-15641)
weakref.WeakValueDictionary defines a local remove() function used as
callback for weak references. This function was created with a
closure.  Modify the implementation to avoid the closure.
(cherry picked from commit a2af05a0d3)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-09-09 09:24:16 -07:00
Miss Islington (bot) b6ef8f2beb
bpo-37876: Tests for ROT-13 codec (GH-15314)
The Rot-13 codec is for educational use but does not have unit tests,
dragging down test coverage. This adds a few very simple tests.
(cherry picked from commit b3b48c81f0)

Co-authored-by: Zeth <theology@gmail.com>
2019-09-09 09:12:01 -07:00
Miss Islington (bot) 0d4396c04c
bpo-38059: Using sys.exit() over exit() in inspect.py (GH-15666)
Constants added by the site module like exit() "should not be used in programs"
(cherry picked from commit e3c59a7527)

Co-authored-by: Alan Yee <alanyee@users.noreply.github.com>
2019-09-09 08:20:36 -07:00
Miss Islington (bot) 3bd4bed78a bpo-34596: Fallback to a default reason when @unittest.skip is uncalled (GH-9082) (#15781)
* bpo-34596: Fallback to a default reason when @unittest.skip is uncalled

* Change default reason to empty string

* Fix rst formatting of NEWS entry
(cherry picked from commit d5fd75c53f)

Co-authored-by: Naitree Zhu <Naitreey@gmail.com>
2019-09-09 17:01:14 +02:00
Miss Islington (bot) bee8bfe5f4
bpo-37212: Preserve keyword argument order in unittest.mock.call and error messages (GH-14310)
(cherry picked from commit 9d607061c9)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-09-09 04:42:43 -07:00
Miss Islington (bot) 87a5a331ea
bpo-36250: ignore ValueError from signal in non-main thread (GH-12251)
Authored-By: blueyed <github@thequod.de>
(cherry picked from commit 8d64bfafdf)

Co-authored-by: Daniel Hahler <github@thequod.de>
2019-09-09 04:25:21 -07:00
Steve Dower eb02196bd9
bpo-11953: Extend table of Windows WSA* error codes (GH-15004) 2019-09-09 03:36:04 -07:00
Miss Islington (bot) ebca7eb093
bpo-32587: Make winreg.REG_MULTI_SZ support zero-length strings (GH-13239)
* bpo-32587: Make winreg.REG_MULTI_SZ support PendingFileRenameOperations

* Address review comments.
(cherry picked from commit e223ba13d8)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-09-09 03:11:00 -07:00
Miss Islington (bot) 6e3809c7ce
bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625)
RuntimeError is now raised in this case.
(cherry picked from commit 526a01467b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-09-09 02:07:51 -07:00
Raymond Hettinger cc1bdf91d5
[3.8] bpo-36018: Address more reviewer feedback (GH-15733) (GH-15734) 2019-09-08 18:40:06 -07:00
Miss Islington (bot) 4009a8522d
bpo-38041: Refine IDLE Shell restart lines. (GH-15709)
Restart lines now always start with '=' and never end with ' ' and fill the width of the window unless that would require ending with ' ', which could be wrapped by itself and possible confusing the user.
(cherry picked from commit 38da805d56)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-09-06 11:14:49 -07:00
Miss Islington (bot) 4d1abedce9 bpo-37380: subprocess: don't use _active on win (GH-14360) (GH-15707)
As noted by @eryksun in [1] and [2], using _cleanup and _active(in
__del__) is not necessary on Windows, since:

> Unlike Unix, a process in Windows doesn't have to be waited on by
> its parent to avoid a zombie. Keeping the handle open will actually
> create a zombie until the next _cleanup() call, which may be never
> if Popen() isn't called again.

This patch simply defines `subprocess._active` as `None`, for which we already
have the proper logic in place in `subprocess.Popen.__del__`, that prevents it
from trying to append the process to the `_active`. This patch also defines
`subprocess._cleanup` as a noop for Windows.

[1] https://bugs.python.org/issue37380GH-msg346333
[2] https://bugs.python.org/issue36067GH-msg336262

Signed-off-by: Ruslan Kuprieiev <ruslan@iterative.ai>
(cherry picked from commit 042821ae3c)

Co-authored-by: Ruslan Kuprieiev <kupruser@gmail.com>
2019-09-06 11:14:31 +02:00
Miss Islington (bot) dafbe32656 bpo-36324: Apply review comments from Allen Downey (GH-15693) (GH-15694)
(cherry picked from commit e4810b2a6c)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-09-05 00:42:22 -07:00
Miss Islington (bot) bdcbb83c66
bpo-38026: fix inspect.getattr_static (GH-15676)
It should avoid dynamic lookup including `isinstance`.

This is a regression caused by GH-5351.
(cherry picked from commit 8f9cc8771f)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-09-04 21:25:59 -07:00