Commit Graph

26509 Commits

Author SHA1 Message Date
Miss Islington (bot) 0e4d526de4
bpo-41811: create SortKey members using first given value (GH-22316) (GH-22325)
(cherry picked from commit ae0d2a33ec)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2020-09-19 12:56:13 -07:00
Ethan Furman a9ba8ba9a7
[3.9] bpo-39728: Enum: fix duplicate `ValueError` (GH-22277) (GH-22282)
fix default `_missing_` to return `None` instead of raising a `ValueError`
Co-authored-by: Andrey Darascheka <andrei.daraschenka@leverx.com>
(cherry picked from commit c95ad7a91f)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2020-09-16 17:37:51 -07:00
Miss Islington (bot) 4465df6266
_auto_called cleanup (GH-22285)
(cherry picked from commit fc23a9483e)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2020-09-16 17:27:09 -07:00
Miss Islington (bot) 48f99250ff
bpo-41517: do not allow Enums to be extended (GH-22271)
fix bug that let Enums be extended via multiple inheritance
(cherry picked from commit 3064dbf5df)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2020-09-16 07:35:14 -07:00
Łukasz Langa 7e356f17e4
[3.9] bpo-41687: Fix sendfile implementation to work with Solaris (GH-22040) (GH-22273)
(cherry picked from commit 8c0be6fd91)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2020-09-16 13:52:26 +02:00
Ethan Furman a4677068dd
[3.9] bpo-41789: honor object overrides in Enum classes (GH-22250) (GH-22272)
EnumMeta double-checks that `__repr__`, `__str__`, `__format__`, and `__reduce_ex__` are not the same as `object`'s, and replaces them if they are -- even if that replacement was intentionally done in the Enum being constructed.  This patch fixes that.
2020-09-16 03:58:33 -07:00
Miss Islington (bot) 95b81e2f8c
bpo-39587: Enum - use correct mixed-in data type (GH-22263) (GH-22266)
(cherry picked from commit bff01f3a3a)
2020-09-15 16:59:48 -07:00
Miss Islington (bot) 49917d576a
bpo-41780: Fix __dir__ of types.GenericAlias (GH-22262)
Automerge-Triggered-By: @gvanrossum
(cherry picked from commit 2e87774df1)

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2020-09-15 16:37:13 -07:00
Pablo Galindo 55e0836849
[3.9] bpo-41631: _ast module uses again a global state (GH-21961) (GH-22258)
Partially revert commit ac46eb4ad6662cf6d771b20d8963658b2186c48c:
"bpo-38113: Update the Python-ast.c generator to PEP384 (gh-15957)".

Using a module state per module instance is causing subtle practical
problems.

For example, the Mercurial project replaces the __import__() function
to implement lazy import, whereas Python expected that "import _ast"
always return a fully initialized _ast module.

Add _PyAST_Fini() to clear the state at exit.

The _ast module has no state (set _astmodule.m_size to 0). Remove
astmodule_traverse(), astmodule_clear() and astmodule_free()
functions..
(cherry picked from commit e5fbe0cbd4)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-09-15 20:32:56 +02:00
Miss Islington (bot) 34e3c7592b
bpo-41731: Make test_cmd_line_script pass with -vv (GH-22206)
Argument script_exec_args is usually an absolute file name,
but twice has form ['-m', 'module_name'].
(cherry picked from commit 7e711ead26)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-09-11 23:45:34 -07:00
Miss Islington (bot) 11a82c7220
bpo-41525: Make the Python program help ASCII-only (GH-21836)
(cherry picked from commit 58de1dd6a8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-09-08 17:47:53 -07:00
Miss Islington (bot) 1671b0e4e0
bpo-41720: Add "return NotImplemented" in turtle.Vec2D.__rmul__(). (GH-22092)
(cherry picked from commit fd4cafd470)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-09-07 09:30:21 -07:00
Victor Stinner c73ee5acc9
bpo-41401: Fix test_fspath_support in test_io. (GH-21640) (GH-22133)
The error is exposed on non-UTF-8 locales.

(cherry picked from commit 67987acd5d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-09-07 16:45:57 +02:00
Miss Islington (bot) a708ae7470
bpo-41218: Improve the test cases for test_compile_top_level_await_no_coro (GH-21363) (GH-22109)
(cherry picked from commit c2c1f1f906)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-09-05 16:37:04 +01:00
Miss Islington (bot) d64d78be20
bpo-41531: Fix compilation of dict literals with more than 0xFFFF elements (GH-21850) (GH-22107)
(cherry picked from commit c51db0ea40)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-09-05 00:38:50 +01:00
Miss Islington (bot) e92219d8f8
bpo-29590: fix stack trace for gen.throw() with yield from (GH-19896)
* Add failing test.

* bpo-29590: fix stack trace for gen.throw() with yield from (GH-NNNN)

When gen.throw() is called on a generator after a "yield from", the
intermediate stack trace entries are lost.  This commit fixes that.
(cherry picked from commit 8b33961e4b)

Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
2020-09-04 16:07:18 -07:00
Miss Islington (bot) 8f13ff959a
bpo-41700: Skip test if the locale is not supported (GH-22081) (GH-22085)
(cherry picked from commit 54a66ade20)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-09-04 18:55:25 +09:00
Miss Islington (bot) 8d68e59f11
bpo-39010: Improve test shutdown (GH-22066) (#22082)
Simply closing the event loop isn't enough to avoid warnings. If we
don't also shut down the event loop's default executor, it sometimes
logs a "dangling thread" warning.

Follow-up to GH-22017
(cherry picked from commit be435ae2b0)

Co-authored-by: Ben Darnell <ben@bendarnell.com>

Co-authored-by: Ben Darnell <ben@bendarnell.com>
2020-09-03 13:54:43 -07:00
Miss Islington (bot) a2680058ee
bpo-41696: Fix handling of debug mode in asyncio.run (GH-22069) (#22071)
* bpo-41696: Fix handling of debug mode in asyncio.run

This allows PYTHONASYNCIODEBUG or -X dev to enable asyncio debug mode
when using asyncio.run

* 📜🤖 Added by blurb_it.

Co-authored-by: hauntsaninja <>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 0770ad948c)

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

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2020-09-03 13:54:09 -07:00
Miss Islington (bot) 49571c0b0e
bpo-39010: Fix errors logged on proactor loop restart (GH-22017) (#22034)
Stopping and restarting a proactor event loop on windows can lead to
spurious errors logged (ConnectionResetError while reading from the
self pipe). This fixes the issue by ensuring that we don't attempt
to start multiple copies of the self-pipe reading loop.
(cherry picked from commit ea5a6363c3)

Co-authored-by: Ben Darnell <ben@bendarnell.com>

Co-authored-by: Ben Darnell <ben@bendarnell.com>
2020-09-03 12:38:29 -07:00
Pablo Galindo 270e249290
[3.9] Fix 'gather' rules in the python parser generator (GH-22021) (GH-22080)
Currently, empty sequences in gather rules make the conditional for
gather rules fail as empty sequences evaluate as "False". We need to
explicitly check for "None" (the failure condition) to avoid false
negatives.
(cherry picked from commit e55a0e9)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-09-03 16:35:36 +01:00
Miss Islington (bot) 63fa113c60
Fixed mistake in test for f-string error description (GH-22036) (GH-22059) (GH-22060)
(cherry picked from commit 749ed85e44)

Co-authored-by: han-solo <hanish0019@gmail.com>

Co-authored-by: han-solo <hanish0019@gmail.com>
2020-09-02 08:13:39 -04:00
Pablo Galindo d14775ddbb
[3.9] bpo-41654: Fix deallocator of MemoryError to account for subclasses (GH-22020) (GH-22045)
When allocating MemoryError classes, there is some logic to use
pre-allocated instances in a freelist only if the type that is being
allocated is not a subclass of MemoryError. Unfortunately in the
destructor this logic is not present so the freelist is altered even
with subclasses of MemoryError..
(cherry picked from commit 9b648a95cc)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-09-01 21:40:57 +01:00
Miss Islington (bot) c16a2a1b64
bpo-41681: Fix for `f-string/str.format` error description when using 2 `,` in format specifier (GH-22036) (GH-22041)
* Fixed `f-string/str.format` error description when using two `,` in format specifier.

Co-authored-by: millefalcon <hanish0019@hmail.com>
(cherry picked from commit 0d6aa7f0ee)

Co-authored-by: han-solo <hanish0019@gmail.com>

Co-authored-by: han-solo <hanish0019@gmail.com>
2020-09-01 11:45:59 -04:00
Miss Islington (bot) ca55ecbf9a
bpo-41344: Raise ValueError when creating shared memory of size 0 (GH-21556) (GH-22018)
(cherry picked from commit 475a5fbb56)

Co-authored-by: Vinay Sharma <vinay04sharma@icloud.com>

Co-authored-by: Vinay Sharma <vinay04sharma@icloud.com>
2020-08-30 20:42:22 +01:00
Miss Islington (bot) 7361451b97
bpo-41609: Fix output of pdb's whatis command for instance methods (GH-21935) (#21977)
(cherry picked from commit 022bc7572f)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
2020-08-27 03:17:40 +02:00
Miss Islington (bot) 211e4c6e9c
bpo-33660: Fix PosixPath to resolve a relative path on root (#21974)
(cherry picked from commit 94ad6c674f)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-08-27 02:51:44 +02:00
Miss Islington (bot) 9de6be4e2a
bpo-37658: Fix asyncio.wait_for() to respect waited task status (GH-21894) (GH-21964)
Currently, if `asyncio.wait_for()` itself is cancelled it will always
raise `CancelledError` regardless if the underlying task is still
running.  This is similar to a race with the timeout, which is handled
already.
(cherry picked from commit a2118a1462)

Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
2020-08-26 19:15:35 +02:00
Miss Islington (bot) 1036ccb55d
bpo-32751: Wait for task cancel in asyncio.wait_for() when timeout <= 0 (GH-21895) (GH-21963)
When I was fixing bpo-32751 back in GH-7216 I missed the case when
*timeout* is zero or negative.  This takes care of that.

Props to @aaliddell for noticing the inconsistency.
(cherry picked from commit c517fc7121)

Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
2020-08-26 19:14:59 +02:00
Miss Islington (bot) 2c050e52f1
[3.9] bpo-41503: Fix race between setTarget and flush in logging.handlers.MemoryHandler (GH-21765) (GH-21897)
(cherry picked from commit 2353d77fad)


Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>

Automerge-Triggered-By: @vsajip
2020-08-16 08:34:27 -07:00
Miss Islington (bot) 28bf82661a
bpo-41540: AIX: skip test that is flaky with a default ulimit. (GH-21890) (#21893)
- AIX has extreme over-allocation that is in no relation to the physical
    RAM and swap.

(cherry picked from commit 39dab24621)

Authored-by: Stefan Krah <skrah@bytereef.org>
2020-08-15 20:40:14 +02:00
Miss Islington (bot) 33d3c64095
bpo-41025: Fix subclassing for zoneinfo.ZoneInfo (GH-20965) (GH-21876)
Prior to this change, attempting to subclass the C implementation of
zoneinfo.ZoneInfo gave the following error:

    TypeError: unbound method ZoneInfo.__init_subclass__() needs an argument

https://bugs.python.org/issue41025
(cherry picked from commit 87d8287865)

Co-authored-by: Paul Ganssle <paul@ganssle.io>
2020-08-14 11:18:24 -04:00
Terry Jan Reedy f24430f154
[3.9] bpo-41520: Fix second codeop regression (GH-21848)
Fix the repression introduced by the initial regression fix.

(cherry picked from commit c818b15fa5)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-08-13 14:21:32 -04:00
Miss Islington (bot) 90eff4ed44
bpo-41520: codeop no longer ignores SyntaxWarning (GH-21838)
(cherry picked from commit 369a1cbdee)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-08-12 06:13:09 -07:00
Łukasz Langa 439c93d51f
Python 3.9.0rc1 2020-08-11 20:58:17 +02:00
Victor Stinner a0b57b3317
bpo-38912: regrtest logs unraisable exception into sys.__stderr__ (GH-21718) (GH-21827)
regrtest_unraisable_hook() temporarily replaces sys.stderr with
sys.__stderr__ to help to display errors when a test captures stderr.

(cherry picked from commit 701b63894f)
2020-08-11 17:03:33 +02:00
Steve Dower 70e9243a55
bpo-41490: Update ensurepip to install pip 20.2.1 and setuptools 49.2.1 (GH-21774) 2020-08-08 00:47:40 +01:00
Miss Islington (bot) 5e12a5b822
bpo-41473: Skip test_gdb with gdb 9.2 to work around gdb bug (GH-21768)
gdb 9.2 on Fedora Rawhide is not reliable, see:

* https://bugs.python.org/issue41473
* https://bugzilla.redhat.com/show_bug.cgi?id=1866884
(cherry picked from commit e27a51c11e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-08-07 09:18:29 -07:00
Miss Islington (bot) a1320989f5
bpo-40726: handle uninitalized end_lineno on ast.increment_lineno (GH-20312)
(cherry picked from commit 8f4380d2f5)

Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
2020-08-05 06:52:29 -07:00
Karthikeyan Singaravelan fe928b32da
[3.9] bpo-40360: Handle PendingDeprecationWarning in test_lib2to3. (GH-21694) (GH-21697)
(cherry picked from commit cadda52d97)

Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
2020-07-31 07:17:18 -07:00
Miss Islington (bot) 41d1c04f73
bpo-41341: Recursive evaluation of ForwardRef in get_type_hints (GH-21553)
The issue raised by recursive evaluation is infinite recursion with
recursive types. In that case, only the first recursive ForwardRef is
evaluated.
(cherry picked from commit 653f420b53)

Co-authored-by: wyfo <joperez@hotmail.fr>
2020-07-26 08:31:24 -07:00
Miss Islington (bot) 8b7544cd02
bpo-41385: Fix test_executable_without_cwd on Windows (GH-21608)
(cherry picked from commit b1a87300a0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-07-26 00:38:52 -07:00
Berker Peksag 2024d7aca1
bpo-38731: Fix NameError in command-line interface of py_compile (GH-21617) 2020-07-25 23:43:47 +03:00
Miss Islington (bot) 4ff8e5ba4f
bpo-41317: Remove reader on cancellation in asyncio.loop.sock_accept() (GH-21595)
(cherry picked from commit 0dd98c2d00)

Co-authored-by: Alex Grönholm <alex.gronholm@nextday.fi>
2020-07-23 13:02:47 -07:00
Miss Islington (bot) 01ab963460
bpo-41295: Reimplement the Carlo Verre "hackcheck" (GH-21528)
Walk down the MRO backwards to find the type that originally defined the final `tp_setattro`, then make sure we are not jumping over intermediate C-level bases with the Python-level call.

Automerge-Triggered-By: @gvanrossum
(cherry picked from commit c53b310e59)

Co-authored-by: scoder <stefan_ml@behnel.de>
2020-07-18 14:39:02 -07:00
Miss Islington (bot) 27b811057f
bpo-39603: Prevent header injection in http methods (GH-18485)
reject control chars in http method in http.client.putrequest to prevent http header injection
(cherry picked from commit 8ca8a2e8fb)

Co-authored-by: AMIR <31338382+amiremohamadi@users.noreply.github.com>
2020-07-18 13:41:55 -07:00
Miss Islington (bot) 28e93dd2b2
bpo-41304: Ensure python3x._pth is loaded on Windows (GH-21495)
(cherry picked from commit 936a660945)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-07-15 15:14:48 -07:00
Miss Islington (bot) f3232294ee
[3.9] bpo-39017: Avoid infinite loop in the tarfile module (GH-21454) (GH-21482)
Avoid infinite loop when reading specially crafted TAR files using the tarfile module
(CVE-2019-20907).
(cherry picked from commit 5a8d121a1f)


Co-authored-by: Rishi <rishi_devan@mail.com>

Automerge-Triggered-By: @encukou
2020-07-15 05:30:33 -07:00
Miss Islington (bot) 57c984fab6
bpo-41288: Fix a crash in unpickling invalid NEWOBJ_EX. (GH-21458)
Automerge-Triggered-By: @tiran
(cherry picked from commit 4f309abf55)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-07-13 06:09:27 -07:00
Miss Islington (bot) c65ee55512
bpo-41172: Fix check for compiler in test suite (GH-21400)
(cherry picked from commit af56c4fc76)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-07-09 11:12:07 -07:00