Commit Graph

22010 Commits

Author SHA1 Message Date
Miss Islington (bot) 61b49a00e7
bpo-40561: Add docstrings for webbrowser open functions (GH-19999)
Co-authored-by: Brad Solomon <brsolomon@deloitte.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit ef7973a981)

Co-authored-by: Brad Solomon <brad.solomon.1124@gmail.com>
2020-05-11 12:06:32 -07:00
Miss Islington (bot) 2501428988
[3.7] bpo-40559: Add Py_DECREF to _asynciomodule.c:task_step_impl() (GH-19990)
This fixes a possible memory leak in the C implementation of
asyncio.Task.
(cherry picked from commit d2c349b190)

Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
2020-05-08 04:30:30 -07:00
Robert Rouhani d64fd617e0
[3.7] bpo-40417: Fix deprecation warning in PyImport_ReloadModule (GH-19750) (GH-19935)
Use importlib instead of imp.

Automerge-Triggered-By: @brettcannon.
(cherry picked from commit f40bd46)

Co-authored-by: Robert Rouhani robert.rouhani@gmail.com
2020-05-05 17:49:29 -07:00
Miss Islington (bot) 8ddf915438
bpo-40459: Fix NameError in platform.py (GH-19855)
(cherry picked from commit 1e7e4519a8)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2020-05-04 19:51:33 -07:00
Antoine Pitrou 3859b1ac1d
[3.7] bpo-39435: Fix docs for pickle.loads (GH-18160). (GH-19844)
(cherry picked from commit 289842ae82)

Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>

Automerge-Triggered-By: @pitrou
2020-05-01 12:53:35 -07:00
Miss Islington (bot) beba1a8080
bpo-40436: Fix code parsing gdb version (GH-19792)
test_gdb and test.pythoninfo now check gdb command exit code.
(cherry picked from commit ec9bea4a37)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-04-29 08:30:46 -07:00
Zachary Ware 70ba81459e
[3.7] bpo-38387: Formally document PyDoc_STRVAR and PyDoc_STR macros (GH-16607) (GH-19728)
Adds a short description of `PyDoc_STRVAR` and `PyDoc_STR` to "Useful macros" section of C-API docs.

Currently, there is [one lone mention](https://docs.python.org/3/c-api/module.html?highlight=pydoc_strvarGH-c.PyModuleDef) in the C-API reference, despite the fact that `PyDoc_STRVAR` is ubiquitous to `Modules/`.

Additionally, this properly uses `c:macro` within `Doc/c-api/module.rst` to link..
(cherry picked from commit b54e46cb57)

Co-authored-by: Brad Solomon <brad.solomon.1124@gmail.com>
2020-04-26 21:46:06 -05:00
Victor Stinner fd32a0e2ee
[3.7] bpo-38546: Backport multiprocessing tests fixes from master (GH-19689)
* bpo-37421: multiprocessing tests call _run_finalizers() (GH-14527)

multiprocessing tests now call explicitly _run_finalizers() to remove
immediately temporary directories created by
multiprocessing.util.get_temp_dir().
(cherry picked from commit 039fb49c18)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
(cherry picked from commit 632cb36084)

* bpo-37421: multiprocessing tests now stop ForkServer (GH-14601)

multiprocessing tests now stop the ForkServer instance if it's
running: close the "alive" file descriptor to ask the server to stop
and then remove its UNIX address.
(cherry picked from commit 8fbeb14312)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
(cherry picked from commit 229f6e85f8)

* bpo-38546: multiprocessing tests stop the resource tracker (GH-17641) (GH-17647)

Multiprocessing and concurrent.futures tests now stop the resource
tracker process when tests complete.

Add ResourceTracker._stop() method to
multiprocessing.resource_tracker.

Add _cleanup_tests() helper function to multiprocessing.util: share
code between multiprocessing and concurrent.futures tests.

(cherry picked from commit 9707e8e22d)
(cherry picked from commit 35acb35972)

* Remove NEWS about resource tracker

Python 3.7 multiprocessing does not have resource tracker.

Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
2020-04-24 00:44:08 +02:00
Victor Stinner 857d573257
bpo-39932: Fix multiprocessing test_heap() (GH-19690)
bpo-32759, bpo-39932: Fix multiprocessing test_heap():
a new Heap object is now created for each test run.

Partial backport of commit e4679cd644
by Antoine Pitrou.
2020-04-24 00:20:00 +02:00
Florian Bruhin e1072d60db
[3.7] gdbinit: Use proper define syntax (GH-19557) (GH-19678)
Using `def` rather than `define` results in:

    Ambiguous command "def pu": define, define-prefix.

Automerge-Triggered-By: @csabella.
(cherry picked from commit 1221135289)

Co-authored-by: Florian Bruhin <me@the-compiler.org>
2020-04-23 08:53:23 -07:00
Miss Islington (bot) e7f8684ef7
bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480)
It is possible to use either '-isysroot /some/path' (with a space) or
'-isysroot/some/path' (no space in between). Support both forms in
places where special handling of -isysroot is done, rather than just
the first form.
Co-authored-by: Ned Deily <nad@python.org>
(cherry picked from commit b310700976)

Co-authored-by: Joshua Root <jmr@macports.org>
2020-04-22 09:27:24 -07:00
Miss Islington (bot) de5dcfa3bc
bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19654)
Fix the Windows implementation of os.waitpid() for exit code
larger than "INT_MAX >> 8". The exit status is now interpreted as an
unsigned number.
(cherry picked from commit b07350901c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-04-22 09:16:42 -07:00
Miss Islington (bot) abdfb3b471
bpo-38439: Add 256px IDLE icon (GH-17473)
Icon author: Andrew Clover, bpo-1490384
(cherry picked from commit 3a69f3caee)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2020-04-22 00:38:37 -07:00
Miss Islington (bot) 7ad3adda9b
bpo-40164: Update macOS installer builds to use OpenSSL 1.1.1g. (GH-19642) (GH-19644)
(cherry picked from commit 783a673f23)

Co-authored-by: Ned Deily <nad@python.org>
2020-04-21 23:04:15 -04:00
Miss Islington (bot) 694a95ff43
bpo-39942:Fix failure in `TypeVar` when missing `__name__` (GH-19616)
https://bugs.python.org/issue39942
(cherry picked from commit a25a04fea5)

Co-authored-by: HongWeipeng <hongweichen8888@sina.com>
2020-04-20 13:22:34 -07:00
Miss Islington (bot) 0abb548cc7
bpo-27635: Fix pickle documentation about `__new__` not being called. (GH-19269)
Automerge-Triggered-By: @pitrou
(cherry picked from commit 482259d0dc)

Co-authored-by: Furkan Önder <furkantahaonder@gmail.com>
2020-04-18 11:14:41 -07:00
Serhiy Storchaka 67ae454da7
[3.7] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) (GH-19584)
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
(cherry picked from commit 12446e6a60)
2020-04-18 19:12:14 +03:00
Miss Islington (bot) c46dc6f72b
bpo-38492: Remove pythonw.exe dependency on the Microsoft C++ runtime (GH-16824)
(cherry picked from commit 7aebbd1182)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-04-17 16:31:28 -07:00
Miss Islington (bot) 11ae7d0752
bpo-40287: Fix SpooledTemporaryFile.seek() return value (GH-19540)
It has not returned the file position after the seek.
(cherry picked from commit 485e715cb1)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-04-17 00:13:34 -07:00
Miss Islington (bot) cd09d7e55d
bpo-39793: use the same domain on make_msgid tests (GH-18698) (GH-19555)
(cherry picked from commit 5565c30f0b)

Co-authored-by: Batuhan Taşkaya <batuhanosmantaskaya@gmail.com>
2020-04-16 14:08:59 -04:00
Victor Stinner b894b669c9
Update libregrtest from master (GH-19517)
* bpo-36670: regrtest bug fixes (GH-16537)

* Fix TestWorkerProcess.__repr__(): start_time is only valid
  if _popen is not None.
* Fix _kill(): don't set _killed to True if _popen is None.
* _run_process(): only set _killed to False after calling
  run_test_in_subprocess().

(cherry picked from commit 2ea71a07d0)

* [3.8] Update libregrtest from master (GH-19516)

* bpo-37531: regrtest now catchs ProcessLookupError (GH-16827)

Fix a warning on a race condition on TestWorkerProcess.kill(): ignore
silently ProcessLookupError rather than logging an useless warning.

(cherry picked from commit a661392f8f)

* bpo-38502: regrtest uses process groups if available (GH-16829)

test.regrtest now uses process groups in the multiprocessing mode
(-jN command line option) if process groups are available: if
os.setsid() and os.killpg() functions are available.

(cherry picked from commit ecb035cd14)

* bpo-37957: Allow regrtest to receive a file with test (and subtests) to ignore (GH-16989)

When building Python in some uncommon platforms there are some known tests that will fail. Right now, the test suite has the ability to ignore entire tests using the -x option and to receive a filter file using the --matchfile filter. The problem with the --matchfile option is that it receives a file with patterns to accept and when you want to ignore a couple of tests and subtests, is too cumbersome to lists ALL tests that are not the ones that you want to accept and he problem with -x is that is not easy to ignore just a subtests that fail and the whole test needs to be ignored.

For these reasons, add a new option to allow to ignore a list of test and subtests for these situations.

(cherry picked from commit e0cd8aa70a)

* regrtest: log timeout at startup (GH-19514)

Reduce also worker timeout.

(cherry picked from commit 4cf65a630a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit 67b8a1f0f0)

* bpo-36842: Fix reference leak in tests by running out-of-proc (GH-13556)

(cherry picked from commit 9ddc416e9f)

* Backport libregrtest changes from master

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-04-15 01:05:20 +02:00
Miss Islington (bot) 096e41aa4e
[3.7] bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object (GH-3997) (GH-19487)
(cherry picked from commit 402e1cdb13)
2020-04-12 19:15:35 +02:00
Serhiy Storchaka 4057e8f9b5
[3.7] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) (GH-19484)
Patcher's __exit__() is now never called if its __enter__() is failed.
Returning true from __exit__() silences now the exception.
(cherry picked from commit 4b222c9491)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-04-12 14:54:03 +03:00
Victor Stinner 9e5f159d32
bpo-40204: Pin Sphinx version to 1.8.2 in Doc/Makefile (GH-19442) (GH-19443)
(cherry picked from commit 37a257c0ae)
2020-04-10 01:40:58 +02:00
Miss Islington (bot) a514ccb3ea
bpo-40089: Fix threading._after_fork() (GH-19191) (GH-19193)
If fork was not called by a thread spawned by threading.Thread,
threading._after_fork() now creates a _MainThread instance for
_main_thread, instead of a _DummyThread instance.
(cherry picked from commit d8ff44ce4c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-04-07 23:36:07 +02:00
Miss Islington (bot) 717f1668b3
bpo-40196: Fix a bug in the symtable when reporting inspecting global variables (GH-19391)
(cherry picked from commit 799d7d61a9)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-04-06 09:41:24 -07:00
Steve Dower e7a47c23dd
bpo-40164: Update Windows to OpenSSL 1.1.1f (GH-19359) 2020-04-04 15:47:46 +01:00
Miss Islington (bot) 681044a0ab
bpo-38689: avoid IDLE hanging when calltip fails getting a signature (GH-17152)
Inspect.signature failed on the test case because its isinstance call raised.
(cherry picked from commit 52013e5b6d)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2020-04-03 20:24:39 -07:00
Miss Islington (bot) 7f70456b92
bpo-40158: Fix CPython MSBuild Properties in NuGet Package (GH-19343)
Fix default Python home path relative to the NuGet package
(cherry picked from commit 6e623ff9d2)

Co-authored-by: Chris Martinez <sydefekt@hotmail.com>
2020-04-03 23:18:26 +01:00
Tim Hatch 96c5f5a3a3
[3.7] bpo-36541: lib2to3: Support named assignment expressions (GH-12702) (GH-19317)
lib2to3: Support named assignment expressions (GH-12702)

There are two copies of the grammar -- the one used by Python itself as
Grammar/Grammar, and the one used by lib2to3 which has necessarily diverged at
Lib/lib2to3/Grammar.txt because it needs to support older syntax an we want it
to be reasonable stable to avoid requiring fixer rewrites.

This brings suport for syntax like `if x:= foo():` to match what the live
Python grammar does.

This should've been added at the time of the walrus operator itself, but lib2to3 being
independent is often overlooked.  So we do consider this a bugfix rather than enhancement.

(cherry picked from commit 3c3aa4516c)

Co-authored-by: Tim Hatch <tim@timhatch.com>
2020-04-03 12:14:15 -07:00
Miss Islington (bot) 1ba6fe43e8
bpo-40162: Update Travis CI config to OpenSSL 1.1.1f (GH-19319)
(cherry picked from commit b1ffb8b723)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-04-02 18:21:37 -07:00
Miss Islington (bot) b57a73694e
bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284) (GH-19297)
The AbstractBasicAuthHandler class of the urllib.request module uses
an inefficient regular expression which can be exploited by an
attacker to cause a denial of service. Fix the regex to prevent the
catastrophic backtracking. Vulnerability reported by Ben Caller
and Matt Schwager.

AbstractBasicAuthHandler of urllib.request now parses all
WWW-Authenticate HTTP headers and accepts multiple challenges per
header: use the realm of the first Basic challenge.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>

(cherry picked from commit 0b297d4ff1)
2020-04-02 12:16:17 +02:00
Miss Islington (bot) 8e069fc2ee
bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19288)
(cherry picked from commit 224e1c34d6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-04-01 18:23:15 -07:00
Miss Islington (bot) a764a1cc66
bpo-40019: Skip test_gdb if Python was optimized (GH-19081)
test_gdb now skips tests if it detects that gdb failed to read debug
information because the Python binary is optimized.
(cherry picked from commit 7bf069b611)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-03-31 10:28:35 -07:00
Miss Islington (bot) 9387678f8a
bpo-1812: Fix newline conversion when doctest.testfile loads from a package whose loader has a get_data method (GH-17385)
This pull request fixes the newline conversion bug originally reported in bpo-1812. When that issue was originally submitted, the open builtin did not default to universal newline mode; now it does, which makes the issue fix simpler, since the only code path that needs to be changed is the one in doctest._load_testfile where the file is loaded from a package whose loader has a get_data method.
(cherry picked from commit e0b8101492)

Co-authored-by: Peter Donis <peterdonis@alum.mit.edu>
2020-03-26 09:18:55 -07:00
Miss Islington (bot) ea0eeb8d3a
bpo-39879: Update datamodel docs to include dict ordering (GH-19006)
Co-authored-by: furkanonder <furkantahaonder@gmail.com>
(cherry picked from commit 59c644eaa7)

Co-authored-by: Lahfa Samy <lahfa121999@gmail.com>
2020-03-26 07:59:40 -07:00
Miss Islington (bot) 0dad7486e7
bpo-40016: re docstring: Clarify relationship of inline and argument flags (GH-19078)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 89a2209ae6)

Co-authored-by: Ram Rachum <ram@rachum.com>
2020-03-25 12:03:34 -07:00
Miss Islington (bot) 5753fc6997
bpo-40014: Fix os.getgrouplist() (GH-19126)
Fix os.getgrouplist(): if getgrouplist() function fails because the
group list is too small, retry with a larger group list.

On failure, the glibc implementation of getgrouplist() sets ngroups
to the total number of groups. For other implementations, double the
group list size.
(cherry picked from commit f5c7cabb2b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-03-24 10:39:15 -07:00
Victor Stinner d1c09896c3
bpo-20526: Fix PyThreadState_Clear(): don't decref frame (GH-19120) (GH-19136) (GH-19137)
PyThreadState.frame is a borrowed reference, not a strong reference:
PyThreadState_Clear() must not call Py_CLEAR(tstate->frame).

Remove test_threading.test_warnings_at_exit(): we cannot warranty
that the Python thread state of daemon threads is cleared in a
reliable way during Python shutdown.

(cherry picked from commit 5804f878e7)
(cherry picked from commit e97c8b0688)
2020-03-24 17:56:01 +01:00
Miss Islington (bot) 1cdc61c767
bpo-40014: Fix os.getgrouplist() on macOS (GH-19118)
On macOS, getgrouplist() returns a non-zero value without setting
errno if the group list is too small. Double the list size and call
it again in this case.
(cherry picked from commit 8ec7370c89)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-03-23 12:21:07 -07:00
Jason R. Coombs 5765acaf64
[3.7] bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516) (GH-19111)
* bpo-22490: Remove "__PYVENV_LAUNCHER__" from the shell environment on macOS

This changeset removes the environment varialbe "__PYVENV_LAUNCHER__"
during interpreter launch as it is only needed to communicate between
the stub executable in framework installs and the actual interpreter.

Leaving the environment variable present may lead to misbehaviour when
launching other scripts.

* Actually commit the changes for issue 22490...

* Correct typo

Co-Authored-By: Nicola Soranzo <nicola.soranzo@gmail.com>

* Run make patchcheck

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>.
(cherry picked from commit 044cf94f61)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2020-03-22 15:25:20 -04:00
Serhiy Storchaka 39680fb704
[3.7] bpo-39652: Truncate the column name after '[' only if PARSE_COLNAMES is set. (GH-18942). (GH-19104)
(cherry picked from commit b146568dfc)
2020-03-21 16:33:44 +02:00
Miss Islington (bot) 6056b7b84f
[3.8] bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060) (GH-19090)
test_site.test_startup_imports() is now skipped if a path of sys.path
contains a .pth file.

Sort test_site imports.
(cherry picked from commit ba26bf3094)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-03-20 07:27:54 -07:00
Miss Islington (bot) 34f85af322
bpo-38576: Disallow control characters in hostnames in http.client (GH-18995)
Add host validation for control characters for more CVE-2019-18348 protection.
(cherry picked from commit 9165addc22)

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
2020-03-14 12:12:58 -07:00
Miss Islington (bot) 725cbce250
bpo-39677: dis: rename the operand of MAKE_FUNCTION from `argc` to `flags` for 3.6+ (GC-18550)
(cherry picked from commit 6672c16b1d)

Co-authored-by: Taine Zhao <twshere@outlook.com>
2020-03-14 07:45:11 -07:00
Mark Dickinson 4dcfe5f2e4
[3.7] bpo-39871: Fix possible SystemError in atan2, copysign and remainder (GH-18806) (GH-18990)
In math_2(), the first PyFloat_AsDouble() call should be checked
for failure before the second call.

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>.
(cherry picked from commit 5208b4b379)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-03-14 11:51:53 +00:00
bobince feaf0c3789
[3.7] bpo-39847: EnterNonRecursiveMutex() uses GetTickCount64() (GH-18780) (GH-18959)
The 32-bit (49-day) TickCount relied on in EnterNonRecursiveMutex can overflow
in the gap between the 'target' time and the 'now' time WaitForSingleObjectEx
returns, causing the loop to think it needs to wait another 49 days. This is
most likely to happen when the machine is hibernated during
WaitForSingleObjectEx.

This makes acquiring a lock/event/etc from the _thread or threading module
appear to never timeout.

Replace with GetTickCount64 - this is OK now Python no longer supports XP which
lacks it, and is in use for time.monotonic().

Co-authored-by: And Clover <and.clover@bromium.com>
(cherry picked from commit 64838ce)

Co-authored-by: bobince <and+github@doxdesk.com>
2020-03-12 07:28:31 -07:00
Victor Stinner 6a12676b19
bpo-39884: Add method name in "bad call flags" error (GH-18944) (GH-18957)
_PyMethodDef_RawFastCallDict() and _PyMethodDef_RawFastCallKeywords()
now include the method name in the SystemError "bad call flags" error
message to ease debug.

(cherry picked from commit c7d2d69d95)
2020-03-12 13:37:08 +01:00
Serhiy Storchaka 6f4e7fcfca
[3.7] bpo-38643: Raise SystemError instead of crashing when PyNumber_ToBase is called with invalid base. (GH-18863). (GH-18955)
(cherry picked from commit e5ccc94bbb)
2020-03-12 10:15:17 +02:00
Miss Islington (bot) d0837d2af2
bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304)
(cherry picked from commit 185903de12)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2020-03-11 13:16:36 -07:00