Commit Graph

27502 Commits

Author SHA1 Message Date
Dong-hee Na 551da597a0
bpo-45000: Raise SyntaxError when try to delete __debug__ (GH-27947)
Automerge-Triggered-By: GH:pablogsal
2021-08-25 10:54:20 -07:00
Pablo Galindo Salgado 24da544014
bpo-44929: [Enum] Fix global repr (GH-27789)
* Fix typo in __repr__ code

* Add more tests for global int flag reprs

* use last module if multi-module string
  - when an enum's `__module__` contains several module names, only
     use the last one

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2021-08-25 07:24:32 -07:00
Brandt Bucher 33d95c6fac
bpo-37596: Make `set` and `frozenset` marshalling deterministic (GH-27926) 2021-08-25 13:14:34 +02:00
Pablo Galindo Salgado a24676bedc
Add tests for the C tokenizer and expose it as a private module (GH-27924) 2021-08-24 17:50:05 +01:00
Karthikeyan Singaravelan 7179930ab5
bpo-43826: Fix resource warning due to unclosed objects. (GH-25381) 2021-08-24 16:13:46 +05:30
Ammar Askar bb21e28fd0
bpo-34990: Treat the pyc header's mtime in compileall as an unsigned int (GH-19708)
Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2021-08-24 12:13:32 +03:00
andrei kulakov 27b761a11a
bpo-44980: fix test_constructor to return None value (GH-27898) 2021-08-23 20:50:46 +02:00
Serhiy Storchaka 4d68917386
bpo-44984: Rewrite test_null_strings in _testcapi (GH-27904)
Test also PyObject_Repr(NULL) and PyObject_Bytes(NULL).
2021-08-23 20:05:07 +02:00
Mark Dickinson ae5259171b
Fix bytes.__bytes__ to not truncate at a zero byte (GH-27902) 2021-08-23 15:24:12 +01:00
Dong-hee Na 24b63c695a
bpo-24234: Implement bytes.__bytes__ (GH-27901) 2021-08-23 19:01:51 +09:00
Mark Dickinson 6082bb5add
bpo-24234: implement complex.__complex__ (GH-27887)
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2021-08-23 09:15:49 +01:00
Serhiy Storchaka 585390fdd8
bpo-44968: Fix test_subprocess_wait_no_same_group in test_asyncio (GH-27870)
The code of the test was never executed because the test function
was unintentionally converted to a generator function.
2021-08-21 23:09:08 +03:00
Serhiy Storchaka 4ceec49559
bpo-44524: Do not set _name of _SpecialForm without need (GH-27861)
Because setting non-empty _name affects behavior of other code.

In most cases __name__ can be derived from __origin__.__name__.
2021-08-21 09:47:59 +03:00
Irit Katriel f5d7a8d29c
bpo-44960: add regression test for geometric_mean with mixed int/floa… (#27856)
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2021-08-20 14:08:21 +01:00
Mark Dickinson 60b93d9e49
bpo-44954: Fix wrong result in float.fromhex corner case (GH-27834) 2021-08-20 11:40:11 +01:00
Pablo Galindo Salgado b2f68b1900
bpo-44947: Refine the syntax error for trailing commas in import statements (GH-27814) 2021-08-18 22:09:21 +02:00
Yurii Karabas a3a4d20d67
bpo-44524: Fix cryptic TypeError message when trying to subclass special forms in `typing` (GH-27710)
This was a Python 3.9 regression.
2021-08-18 21:08:32 +02:00
Victor Stinner 6fb62b42f4
bpo-44949: Fix test_readline auto history tests (#27813) 2021-08-18 19:38:54 +02:00
Łukasz Langa 8cf07d3db3
bpo-44852: Support filtering over warnings without a set message (GH-27793)
Additional improvements:

- messages which were compiled regular expressions aren't unpacked back into
  strings for unmatched warnings;

- removed unnecessary "if tokens:" check (there's one before the for loop);

- took `endswith` calculation out of the for loop.
2021-08-18 13:19:30 +02:00
Mark Dickinson 4b9a2dcf19
bpo-44698: Restore complex pow behaviour for small integral exponents (GH-27772) 2021-08-17 17:51:28 +01:00
Maximilian Hils 1512bc21d6
bpo-38956: don't print BooleanOptionalAction's default twice (GH-27672)
Co-authored-by: Micky Yun Chan <michan@redhat.com>
2021-08-16 23:42:21 +02:00
Ken Jin d84d2c4985
bpo-44914: Add tests for some invariants of tp_version_tag (GH-27774) 2021-08-16 20:18:36 +01:00
Guido van Rossum 62bd97303e
Fix a SystemError in code.replace() (#27771)
While the comment said 'We don't bother resizing localspluskinds',
this would cause .replace() to crash when it happened.
(Also types.CodeType(), but testing that is tedious, and this tests all
code paths.)
2021-08-16 11:34:23 -07:00
Łukasz Langa a0a6d39295
bpo-44852: Support ignoring specific DeprecationWarnings wholesale in regrtest (GH-27634) 2021-08-16 20:13:51 +02:00
Irit Katriel 62bc716fde
bpo-44895: skip test_no_hang_on_context_chain_cycle2 until the refleak is fixed (GH-27761) 2021-08-16 10:36:49 +02:00
Gautam Chaudhuri ad0a8a9c62
bpo-16580: [doc] Add examples to int.to_bytes and int.from_bytes (GH-27760)
* added code equivs. for to_bytes and from_bytes

Based on woparry's patch[1] from the relevant issue thread[2].

[1]: https://bugs.python.org/file30372/issue16580.patch
[2]: https://bugs.python.org/issue16580

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2021-08-15 12:29:05 +01:00
andrei kulakov 230403a6a1
Added test case based on recommended test cases from RFC 4648 (GH-27747) 2021-08-13 12:50:37 +02:00
Nikita Sobolev a2ce538e16
bpo-44891: Tests `id` preserving on `* 1` for `str` and `bytes` (GH-27745)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-08-13 12:36:22 +02:00
Irit Katriel 7bf28cbb4b
bpo-44895: Temporarily add an extra gc.collect() call (GH-27746)
This is part of an investigation of a non-deterministic reference leak. While we're looking for the root cause, this is included temporarily so that CI doesn't fail on this particular issue. This enables it to find other regressions in the meantime, which would otherwise be shadowed by our known issue.
2021-08-13 11:41:35 +02:00
Pablo Galindo Salgado 953d27261e
Update pegen to use the latest upstream developments (GH-27586) 2021-08-12 17:37:30 +01:00
Pablo Galindo Salgado 8e832fb2a2
bpo-44885: Correct the ast locations of f-strings with format specs and repeated expressions (GH-27729) 2021-08-12 17:13:30 +01:00
Benjamin Peterson f08e6d1bb3
bpo-33930: Fix typo in the test name. (#27733)
bpo-33930: Fix typo in the test name. (GH-27733)
2021-08-11 18:56:43 -07:00
Zephyr Shannon 81ab8db235
bpo-26228: Fix pty EOF handling (GH-12049)
On non-Linux POSIX platforms, like FreeBSD or macOS,
the FD used to read a forked PTY may signal its exit not
by raising an error but by sending empty data to the read
syscall. This case wasn't handled, leading to hanging
`pty.spawn` calls.

Co-authored-by: Reilly Tucker Siemens <reilly@tuckersiemens.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-08-12 00:21:46 +02:00
Irit Katriel 64a7812c17
Update test__opcode and _Py_GetSpecializationStats with recent specialization stat changes (GH-27728) 2021-08-11 17:34:01 +01:00
Pablo Galindo Salgado bfc2d5a5c4
bpo-33930: Fix segfault with deep recursion when cleaning method objects (GH-27678) 2021-08-11 00:34:14 +01:00
Mark Shannon 9816777861
Classify specialization failures. Provides more useful stats, with lower overhead. (GH-27701) 2021-08-10 14:53:05 +01:00
Irit Katriel d5c217475c
bpo-25782: avoid hang in PyErr_SetObject when current exception has a cycle in its context chain (GH-27626)
Co-authored-by: Dennis Sweeney 36520290+sweeneyde@users.noreply.github.com
2021-08-10 11:37:25 +02:00
Irit Katriel 8ed1833912
bpo-14853: add back the stdin test, skip if stdin is redirected (GH-27694) 2021-08-09 23:38:26 +01:00
Johannes Reiff b33186bc43
bpo-41402: Fix email ContentManager calling .encode() on bytes (GH-21631) 2021-08-09 18:45:41 +02:00
Zackery Spytz eb2d4a66ff
bpo-32695: Docs and tests for compresslevel and preset kwargs in tarfile (GH-21470)
Co-Authored-By: Bo Bayles <bbayles@gmail.com>
2021-08-09 12:05:31 +02:00
Mark Shannon b854557b49
bpo-44840: Compiler: Move duplication of exit blocks with no line numbers to after CFG optimization. (GH-27656) 2021-08-09 10:18:59 +01:00
Raymond Hettinger 1f7d64608b
bpo-44605: Teach @total_ordering() to work with metaclasses (GH-27633) 2021-08-06 14:33:30 -05:00
Bas van Beek 8bdf12e99a
bpo-44524: Fix an issue wherein `_GenericAlias._name` was not properly set for specialforms (GH-27614)
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-08-06 15:36:35 +02:00
Jack DeVries 15d3c14df3
bpo-40928: notify users running test_decimal on macOS of malloc warnings (GH-26783)
* When trying to allocate very large regions on macOS, malloc does not   fail silently. It sends a noisy error out to STDERR
* This provides a helper function to warn the user, and provides the warning for test_decimal, which consistently generates these warnings on macOS.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-08-06 14:50:56 +02:00
Victor Stinner 4d77691172
bpo-44584: Deprecate PYTHONTHREADDEBUG env var (GH-27065)
The threading debug (PYTHONTHREADDEBUG environment variable) is
deprecated in Python 3.10 and will be removed in Python 3.12. This
feature requires a debug build of Python.
2021-08-06 13:11:12 +02:00
Pablo Galindo Salgado f5cbea6b1b
bpo-44838: Refine the custom syntax errors for invalid 'if' expressions (GH-27615) 2021-08-05 18:28:57 +01:00
Kirill Pinchuk 3d315c3116
bpo-44291: Fix reconnection in logging.handlers.SysLogHandler (GH-26490) 2021-08-05 14:58:16 +01:00
Brandon Schabell f99c015638
bpo-44564 Move formatted assertion under deprecation warning context (GH-27090) 2021-08-04 21:01:30 +02:00
Serhiy Storchaka 3875a69547
bpo-44801: Check arguments in substitution of ParamSpec in Callable (GH-27585) 2021-08-04 20:07:01 +02:00
Mark Shannon cee67fa661
bpo-44821: Eagerly assign __dict__ for new objects. (GH-27589) 2021-08-04 16:41:14 +01:00