summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005)Serhiy Storchaka2021-08-2929-11/+121
|
* bpo-25130: Make unit-test about restricting the maximum number of nested ↵Carl Friedrich Bolz-Tereick2021-08-281-32/+35
| | | | | | | | blocks cpython-only (GH-28002) PyPy and potentially other implementations have different or no contraints on the number of blocks that can be statically nested. move the test that checks for this behaviour into a unit test and mark it as CPython-only.
* bpo-45018: Fix rangeiter_reduce in rangeobject.c (GH-27938)chilaxan2021-08-271-16/+31
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-45001: Make email date parsing more robust against malformed input ↵wouter bolsterlee2021-08-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-27946) Various date parsing utilities in the email module, such as email.utils.parsedate(), are supposed to gracefully handle invalid input, typically by raising an appropriate exception or by returning None. The internal email._parseaddr._parsedate_tz() helper used by some of these date parsing routines tries to be robust against malformed input, but unfortunately it can still crash ungracefully when a non-empty but whitespace-only input is passed. This manifests as an unexpected IndexError. In practice, this can happen when parsing an email with only a newline inside a ‘Date:’ header, which unfortunately happens occasionally in the real world. Here's a minimal example: $ python Python 3.9.6 (default, Jun 30 2021, 10:22:16) [GCC 11.1.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import email.utils >>> email.utils.parsedate('foo') >>> email.utils.parsedate(' ') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.9/email/_parseaddr.py", line 176, in parsedate t = parsedate_tz(data) File "/usr/lib/python3.9/email/_parseaddr.py", line 50, in parsedate_tz res = _parsedate_tz(data) File "/usr/lib/python3.9/email/_parseaddr.py", line 72, in _parsedate_tz if data[0].endswith(',') or data[0].lower() in _daynames: IndexError: list index out of range The fix is rather straight-forward: guard against empty lists, after splitting on whitespace, but before accessing the first element.
* bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968)Serhiy Storchaka2021-08-264-7/+10
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-44967: pydoc: return non-zero exit code when query is not found (GH-27868)Gregory Anders2021-08-261-4/+12
|
* bpo-44524: Don't modify MRO when inheriting from typing.Annotated (GH-27841)Ken Jin2021-08-251-0/+5
|
* bpo-45000: Raise SyntaxError when try to delete __debug__ (GH-27947)Dong-hee Na2021-08-251-0/+4
| | | Automerge-Triggered-By: GH:pablogsal
* bpo-44929: [Enum] Fix global repr (GH-27789)Pablo Galindo Salgado2021-08-251-11/+57
| | | | | | | | | | | | * 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>
* bpo-37596: Make `set` and `frozenset` marshalling deterministic (GH-27926)Brandt Bucher2021-08-251-0/+25
|
* Add tests for the C tokenizer and expose it as a private module (GH-27924)Pablo Galindo Salgado2021-08-241-2/+861
|
* bpo-43826: Fix resource warning due to unclosed objects. (GH-25381)Karthikeyan Singaravelan2021-08-241-0/+5
|
* bpo-34990: Treat the pyc header's mtime in compileall as an unsigned int ↵Ammar Askar2021-08-242-9/+31
| | | | | | (GH-19708) Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
* bpo-44980: fix test_constructor to return None value (GH-27898)andrei kulakov2021-08-231-1/+1
|
* bpo-44984: Rewrite test_null_strings in _testcapi (GH-27904)Serhiy Storchaka2021-08-231-0/+12
| | | Test also PyObject_Repr(NULL) and PyObject_Bytes(NULL).
* Fix bytes.__bytes__ to not truncate at a zero byte (GH-27902)Mark Dickinson2021-08-231-2/+2
|
* bpo-24234: Implement bytes.__bytes__ (GH-27901)Dong-hee Na2021-08-232-1/+13
|
* bpo-24234: implement complex.__complex__ (GH-27887)Mark Dickinson2021-08-233-2/+14
| | | Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* bpo-44968: Fix test_subprocess_wait_no_same_group in test_asyncio (GH-27870)Serhiy Storchaka2021-08-211-1/+2
| | | | The code of the test was never executed because the test function was unintentionally converted to a generator function.
* bpo-44524: Do not set _name of _SpecialForm without need (GH-27861)Serhiy Storchaka2021-08-211-1/+0
| | | | | Because setting non-empty _name affects behavior of other code. In most cases __name__ can be derived from __origin__.__name__.
* bpo-44960: add regression test for geometric_mean with mixed int/floa… ↵Irit Katriel2021-08-201-0/+16
| | | | | | (#27856) Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* bpo-44954: Fix wrong result in float.fromhex corner case (GH-27834)Mark Dickinson2021-08-201-0/+14
|
* bpo-44947: Refine the syntax error for trailing commas in import statements ↵Pablo Galindo Salgado2021-08-181-0/+7
| | | | (GH-27814)
* bpo-44524: Fix cryptic TypeError message when trying to subclass special ↵Yurii Karabas2021-08-181-0/+16
| | | | | forms in `typing` (GH-27710) This was a Python 3.9 regression.
* bpo-44949: Fix test_readline auto history tests (#27813)Victor Stinner2021-08-181-2/+6
|
* bpo-44852: Support filtering over warnings without a set message (GH-27793)Łukasz Langa2021-08-181-4/+5
| | | | | | | | | | 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.
* bpo-44698: Restore complex pow behaviour for small integral exponents (GH-27772)Mark Dickinson2021-08-171-0/+28
|
* bpo-38956: don't print BooleanOptionalAction's default twice (GH-27672)Maximilian Hils2021-08-161-7/+14
| | | | Co-authored-by: Micky Yun Chan <michan@redhat.com>
* bpo-44914: Add tests for some invariants of tp_version_tag (GH-27774)Ken Jin2021-08-161-0/+47
|
* Fix a SystemError in code.replace() (#27771)Guido van Rossum2021-08-161-0/+9
| | | | | | | 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.)
* bpo-44852: Support ignoring specific DeprecationWarnings wholesale in ↵Łukasz Langa2021-08-163-0/+68
| | | | regrtest (GH-27634)
* bpo-44895: skip test_no_hang_on_context_chain_cycle2 until the refleak is ↵Irit Katriel2021-08-161-3/+1
| | | | fixed (GH-27761)
* bpo-16580: [doc] Add examples to int.to_bytes and int.from_bytes (GH-27760)Gautam Chaudhuri2021-08-151-0/+42
| | | | | | | | | | * 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>
* Added test case based on recommended test cases from RFC 4648 (GH-27747)andrei kulakov2021-08-131-0/+39
|
* bpo-44891: Tests `id` preserving on `* 1` for `str` and `bytes` (GH-27745)Nikita Sobolev2021-08-132-0/+44
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-44895: Temporarily add an extra gc.collect() call (GH-27746)Irit Katriel2021-08-131-0/+3
| | | 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.
* Update pegen to use the latest upstream developments (GH-27586)Pablo Galindo Salgado2021-08-124-232/+636
|
* bpo-44885: Correct the ast locations of f-strings with format specs and ↵Pablo Galindo Salgado2021-08-121-11/+29
| | | | repeated expressions (GH-27729)
* bpo-33930: Fix typo in the test name. (#27733)Benjamin Peterson2021-08-121-1/+1
| | | bpo-33930: Fix typo in the test name. (GH-27733)
* bpo-26228: Fix pty EOF handling (GH-12049)Zephyr Shannon2021-08-111-17/+52
| | | | | | | | | | 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>
* Update test__opcode and _Py_GetSpecializationStats with recent ↵Irit Katriel2021-08-111-2/+4
| | | | specialization stat changes (GH-27728)
* bpo-33930: Fix segfault with deep recursion when cleaning method objects ↵Pablo Galindo Salgado2021-08-101-0/+15
| | | | (GH-27678)
* Classify specialization failures. Provides more useful stats, with lower ↵Mark Shannon2021-08-101-3/+2
| | | | overhead. (GH-27701)
* bpo-25782: avoid hang in PyErr_SetObject when current exception has a cycle ↵Irit Katriel2021-08-101-0/+142
| | | | | in its context chain (GH-27626) Co-authored-by: Dennis Sweeney 36520290+sweeneyde@users.noreply.github.com
* bpo-14853: add back the stdin test, skip if stdin is redirected (GH-27694)Irit Katriel2021-08-091-0/+16
|
* bpo-41402: Fix email ContentManager calling .encode() on bytes (GH-21631)Johannes Reiff2021-08-091-0/+12
|
* bpo-32695: Docs and tests for compresslevel and preset kwargs in tarfile ↵Zackery Spytz2021-08-091-3/+18
| | | | | (GH-21470) Co-Authored-By: Bo Bayles <bbayles@gmail.com>
* bpo-44840: Compiler: Move duplication of exit blocks with no line numbers to ↵Mark Shannon2021-08-092-60/+82
| | | | after CFG optimization. (GH-27656)
* bpo-44605: Teach @total_ordering() to work with metaclasses (GH-27633)Raymond Hettinger2021-08-061-0/+28
|
* bpo-44524: Fix an issue wherein `_GenericAlias._name` was not properly set ↵Bas van Beek2021-08-061-54/+173
| | | | | | for specialforms (GH-27614) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>