summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
...
* [3.12] gh-114737: Revert change to ElementTree.iterparse "root" attribute ↵Miss Islington (bot)2024-01-311-0/+2
| | | | | | | | | | (GH-114755) (GH-114798) Prior to gh-114269, the iterator returned by ElementTree.iterparse was initialized with the root attribute as None. This restores the previous behavior. (cherry picked from commit 66f95ea6a65deff547cab0d312b8c8c8a4cf8beb) Co-authored-by: Sam Gross <colesbury@gmail.com>
* [3.12] gh-114100: Remove superfluous writing to fd 1 in test_pty (GH-114647) ↵Miss Islington (bot)2024-01-271-1/+21
| | | | | | | (GH-114655) (cherry picked from commit 7a470541e2bbc6f3e87a6d813e2ec42cf726de7a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-77749: Fix inconsistent behavior of non-ASCII handling in ↵Miss Islington (bot)2024-01-261-0/+17
| | | | | | | | | | EmailPolicy.fold() (GH-6986) (GH-114606) It now always encodes non-ASCII characters in headers if utf8 is false. (cherry picked from commit 504334c7be5a56237df2598d338cd494a42fca4c) Co-authored-by: Rito Takeuchi <licht-t@outlook.jp> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-114561: Mark some tests in `test_wincosoleio` with ↵Miss Islington (bot)2024-01-251-1/+4
| | | | | | | `requires_resource('console')` decorator (GH-114565) (cherry picked from commit 33ae9895d4ac0d88447e529038bc4725ddd8c291) Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* [3.12] gh-77465: Increase test coverage for the numbers module (GH-111738) ↵Miss Islington (bot)2024-01-251-1/+157
| | | | | | | | (GH-114556) (cherry picked from commit e721adf4bd47b20ba0a93ad6471084de31bf20c7) Co-authored-by: AN Long <aisk@users.noreply.github.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-113205: test_multiprocessing.test_terminate: Give tasks a chance ↵Miss Islington (bot)2024-01-241-0/+1
| | | | | | | to start (GH-114249) (GH-114516) (cherry picked from commit ce75b4c26d18dcd840fd2e7ee362a84209648d06) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-108303: Move `.whl` test files to `Lib/test/wheeldata/` ↵Miss Islington (bot)2024-01-233-1/+3
| | | | | | | | (GH-114343) (#114488) gh-108303: Move `.whl` test files to `Lib/test/wheeldata/` (GH-114343) (cherry picked from commit ba253a4794ae2d35a6f6df46a98a1ed38bd61268) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-114257: Ignore the FileNotFound error in ctypes.util._is_elf() ↵Miss Islington (bot)2024-01-221-0/+3
| | | | | | | (GH-114394) (GH-114444) (cherry picked from commit 7fc51c3f6b7b13f88480557ff14bdb1c049f9a37) Co-authored-by: AN Long <aisk@users.noreply.github.com>
* [3.12] gh-114275: Skip doctests that use `asyncio` in `test_pdb` for WASI ↵Miss Islington (bot)2024-01-221-202/+208
| | | | | | | | builds (GH-114309) (#114439) gh-114275: Skip doctests that use `asyncio` in `test_pdb` for WASI builds (GH-114309) (cherry picked from commit efb81a60f5ce7e192095230a0f7ff9684d6f835a) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-108303: Remove `Lib/test/shadowed_super.py` (GH-114372) (#114433)Miss Islington (bot)2024-01-222-8/+15
| | | | | | | | gh-108303: Remove `Lib/test/shadowed_super.py` (GH-114372) Move code into Lib/test/test_super.py. (cherry picked from commit 2ef520ebecf5544ba792266a5dbe4d53653a4a03) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-102512: Turn _DummyThread into _MainThread after os.fork() called ↵Miss Islington (bot)2024-01-221-8/+90
| | | | | | | | | | | | | | | | | | | | from a foreign thread (GH-113261) (GH-114430) Always set a _MainThread as a main thread after os.fork() is called from a thread started not by the threading module. A new _MainThread was already set as a new main thread after fork if threading.current_thread() was not called for a foreign thread before fork. Now, if it was called before fork, the implicitly created _DummyThread will be turned into _MainThread after fork. It fixes, in particularly, an incompatibility of _DummyThread with the threading shutdown logic which relies on the main thread having tstate_lock. (cherry picked from commit 49785b06ded19c7c4afce186bac90fea707470ea) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
* [3.12] gh-111803: Make test_deep_nesting from test_plistlib more strict ↵Miss Islington (bot)2024-01-221-2/+3
| | | | | | | | | | (GH-114026) (GH-114406) It is no longer silently passed if RecursionError was raised for low recursion depth. (cherry picked from commit db1c18eb6220653290a3ba9ebbe1df44394a3f19) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-108303: Move `smtpd` to `test.support` (GH-114368) (#114427)Miss Islington (bot)2024-01-223-5/+2
| | | | | | | | gh-108303: Move `smtpd` to `test.support` (GH-114368) Update test_logging.py and test_smtplib.py. (cherry picked from commit 8f5e7d739f56a75022dfe8fa24675b6c7b321ab5) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-114328: tty cbreak mode should not alter ICRNL (GH-114335) (#114410)Miss Islington (bot)2024-01-211-1/+11
| | | | | | The terminal CR -> NL mapping setting should be inherited in cbreak mode as OSes do not specify altering it as part of their stty cbreak mode definition. (cherry picked from commit fd49e226700e2483a452c3c92da6f15d822ae054) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.12] gh-113358: Fix rendering tracebacks with exceptions with a broken ↵Jérome Perrin2024-01-211-0/+15
| | | | __getattr__ (GH-113359) (#114173)
* [3.12] Check for valid tp_version_tag in specializer (gh-89811) (gh-114216)Peter Lazorchak2024-01-191-2/+144
|
* [3.12] gh-108303: Move all doctest related files and tests to ↵Miss Islington (bot)2024-01-1816-116/+151
| | | | | | | | | `Lib/test/test_doctest/` (GH-112109) (#114254) gh-108303: Move all doctest related files and tests to `Lib/test/test_doctest/` (GH-112109) (cherry picked from commit 9c93350f582fe6f5fed2cd873869dfe4fbf2dfe8) Co-authored-by: Nikita Sobolev <mail@sobolevn.me> Co-authored-by: Brett Cannon <brett@python.org>
* [3.12] gh-113205: test_multiprocessing.test_terminate: Shorter sleep for ↵Miss Islington (bot)2024-01-181-1/+9
| | | | | | | | | | | | | | threadpools (GH-114186) (GH-114222) Threads can't be forced to terminate (without potentially corrupting too much state), so the expected behaviour of `ThreadPool.terminate` is to wait for the currently executing tasks to finish. Use shorter sleep time for threadpools, so if a task manages to start, the test doesn't block for long. (cherry picked from commit c1db9606081bdbe0207f83a861a3c70c356d3704) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.12] gh-104522: Fix test_subprocess failure when build Python in the root ↵Miss Islington (bot)2024-01-181-8/+7
| | | | | | | | | home directory (GH-114236) (GH-114239) EPERM is raised when setreuid() fails. EACCES is set in execve() when the test user has not access to sys.executable. (cherry picked from commit 311d1e2701037952eaf75f993be76f3092c1f01c) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-114149: [Enum] revert GH-114196 and add more tuple-subclass tests ↵Miss Islington (bot)2024-01-181-6/+21
| | | | | | | | | | (GH-114215) (GH-114218) gh-114149: [Enum] revert GH-114160 and add more tuple-subclass tests (GH-114215) This reverts commit 05e142b1543eb9662d6cc33722e7e16250c9219f. (cherry picked from commit 4c7e09d0129dafddba58979ced9580f856f65efa) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* [3.12] gh-104522: Fix OSError raised when run a subprocess (GH-114195) (#114219)Miss Islington (bot)2024-01-181-5/+7
| | | | | | | | | | | | gh-104522: Fix OSError raised when run a subprocess (GH-114195) Only set filename to cwd if it was caused by failed chdir(cwd). _fork_exec() now returns "noexec:chdir" for failed chdir(cwd). (cherry picked from commit e2c097ebdee447ded1109f99a235e65aa3533bf8) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Robert O'Shea <PurityLake@users.noreply.github.com>
* [3.12] gh-112343: pdb: Use tokenize to replace convenience variables ↵Tian Gao2024-01-171-1/+10
| | | | (GH-112380) (#114202)
* [3.12] gh-114149: [Enum] fix tuple subclass handling when using custom ↵Miss Islington (bot)2024-01-171-0/+16
| | | | | | | __new__ (GH-114160) (GH-114196) (cherry picked from commit 33b47a2c2853066b549f242065f6c2e12e18b33b) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* [3.12] gh-105102: Fix nested unions in structures when the system byteorder ↵Serhiy Storchaka2024-01-171-0/+19
| | | | | | | is the opposite (GH-105106) (GH-114204) (cherry picked from commit 0b541f64c472976b2fee1ec9919bc7b02a798242) Co-authored-by: Sheidan <37596668+Sh3idan@users.noreply.github.com>
* [3.12] gh-104282: Fix null pointer dereference in ↵Miss Islington (bot)2024-01-171-0/+8
| | | | | | | `lzma._decode_filter_properties` (GH-104283) (GH-114181) (cherry picked from commit 0154405350c272833bd51f68138223655e142a37) Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
* [3.12] gh-113659: Skip hidden .pth files (GH-113660) (GH-114143)Miss Islington (bot)2024-01-161-0/+40
| | | | | | Skip .pth files with names starting with a dot or hidden file attribute. (cherry picked from commit 74208ed0c440244fb809d8acc97cb9ef51e888e3) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-114107: test.pythoninfo logs Windows Developer Mode (GH-114121) ↵Miss Islington (bot)2024-01-161-16/+44
| | | | | | | | | | | | (#114129) gh-114107: test.pythoninfo logs Windows Developer Mode (GH-114121) Also, don't skip the whole collect_windows() if ctypes is missing. Log also ctypes.windll.shell32.IsUserAnAdmin(). (cherry picked from commit c77f552ec02040dfe14a0a3cb743d96eedffadec) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-109862: Fix test_create_subprocess_with_pidfd when it was run ↵Miss Islington (bot)2024-01-151-2/+7
| | | | | | | separately (GH-113991) (GH-114072) (cherry picked from commit f8a79109d0c4f408d34d51861cc0a7c447f46d70) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-95649: Document that asyncio contains uvloop code (GH-107536) ↵Alois Klink2024-01-141-0/+4
| | | | | | | | | | | | (#114046) Some of the asyncio SSL changes in GH-31275 [1] were taken from v0.16.0 of the uvloop project [2]. In order to comply with the MIT license, we need to just need to document the copyright information. [1]: https://github.com/python/cpython/pull/31275 [2]: https://github.com/MagicStack/uvloop/tree/v0.16.0 (cherry picked from commit dce30c9cbc212e5455e100f35ac6afeb30dfd23e)
* [3.12] gh-114014: Update `fractions.Fraction()`'s rational parsing regex ↵Miss Islington (bot)2024-01-131-0/+24
| | | | | | | | | | | | | | (GH-114015) (#114023) Fix a bug in the regex used for parsing a string input to the `fractions.Fraction` constructor. That bug led to an inconsistent exception message being given for some inputs. --------- (cherry picked from commit dd56b5748317c3d504d6a9660d9207620c547f5c) Co-authored-by: Crowthebird <78076854+thatbirdguythatuknownot@users.noreply.github.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Mark Dickinson <dickinsm@gmail.com> Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-111877: Fixes stat() handling for inaccessible files on Windows (GH-113716)Miss Islington (bot)2024-01-121-0/+60
| | | | | (cherry picked from commit ed066481c76c6888ff5709f5b9f93b92c232a4a6) Co-authored-by: Steve Dower <steve.dower@python.org>
* [3.12] gh-113027: Fix test_variable_tzname in test_email (GH-113821) (GH-113831)Miss Islington (bot)2024-01-121-2/+2
| | | | | | | | | Determine the support of the Kyiv timezone by checking the result of astimezone() which uses the system tz database and not the one populated by zoneinfo. (cherry picked from commit 931d7e052e22aa01e18fcc67ed71b6ea305aff71) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-81489: Use Unicode APIs for mmap tagname on Windows (GH-14133)Miss Islington (bot)2024-01-111-2/+4
| | | | | | (cherry picked from commit b4d4aa9e8d61476267951c72321fadffc2d82227) Co-authored-by: Zackery Spytz <zspytz@gmail.com> Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-109858: Protect zipfile from "quoted-overlap" zipbomb (GH-110016) ↵Miss Islington (bot)2024-01-111-0/+60
| | | | | | | | | (GH-113912) Raise BadZipFile when try to read an entry that overlaps with other entry or central directory. (cherry picked from commit 66363b9a7b9fe7c99eba3a185b74c5fdbf842eba) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-113896: Fix test_builtin.BuiltinTest.test___ne__() (GH-113897) ↵Miss Islington (bot)2024-01-101-2/+2
| | | | | | | | | | | | (#113928) gh-113896: Fix test_builtin.BuiltinTest.test___ne__() (GH-113897) Fix DeprecationWarning in test___ne__(). (cherry picked from commit 9d33c23857cfd952bf3e1e7f34c77b7c9a5accc3) Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru> Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-87868: Sort and remove duplicates in getenvironment() (GH-102731)Miss Islington (bot)2024-01-101-0/+46
| | | | | | | | (cherry picked from commit c31be58da8577ef140e83d4e46502c7bb1eb9abf) Co-authored-by: AN Long <aisk@users.noreply.github.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.12] gh-70835: Clarify error message for CSV file opened with wrong ↵Miss Islington (bot)2024-01-101-7/+12
| | | | | | | | newline (GH-113786) (GH-113905) Based on patch by SilentGhost. (cherry picked from commit 568d220993fa9b4b812ff1b425edd80dbe17dda9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-113594: Fix UnicodeEncodeError in TokenList.fold() (GH-113730) ↵Miss Islington (bot)2024-01-101-0/+39
| | | | | | | | (GH-113907) It occurred when try to re-encode an unknown-8bit part combined with non-unknown-8bit part. (cherry picked from commit e9d5b6ea2d68564f176fdf70c2d7028e060c62b5) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-113877: Fix Tkinter method winfo_pathname() on 64-bit Windows ↵Miss Islington (bot)2024-01-101-0/+12
| | | | | | | | | | (GH-113900) (GH-113901) winfo_id() converts the result of "winfo id" command to integer, but "winfo pathname" command requires an argument to be a hexadecimal number on Win64. (cherry picked from commit 1b7e0024a16c1820f61c04a8a100498568410afd) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] GH-113661: unittest runner: Don't exit 5 if tests were skipped ↵Miss Islington (bot)2024-01-091-0/+12
| | | | | | | | | | | | (GH-113856) (#113875) GH-113661: unittest runner: Don't exit 5 if tests were skipped (GH-113856) The intention of exiting 5 was to detect issues where the test suite wasn't discovered at all. If we skipped tests, it was correctly discovered. (cherry picked from commit 3a9096c337c16c9335e0d4eba8d1d4196258af72) Co-authored-by: Stefano Rivera <stefano@rivera.za.net>
* [3.12] gh-113692: skip a test if multiprocessing isn't available. ↵Miss Islington (bot)2024-01-091-1/+3
| | | | | (GH-113704) (GH-113844) (cherry picked from commit 842b738129021f52293dc053e014ecb4fe095baa)
* [3.12] gh-74678: Increase base64 test coverage (GH-21913) (GH-113811)Miss Islington (bot)2024-01-081-0/+3
| | | | | | | | Ensure the character y is disallowed within an Ascii85 5-tuple. (cherry picked from commit 802d4954f12541ba28dd7f18bf4a65054941a80d) Co-authored-by: Zackery Spytz <zspytz@gmail.com> Co-authored-by: Lee Cannon <leecannon@leecannon.xyz>
* [3.12] gh-80109: Fix io.TextIOWrapper dropping the internal buffer during ↵Miss Islington (bot)2024-01-081-0/+8
| | | | | | | | | write() (GH-22535) (GH-113808) io.TextIOWrapper was dropping the internal decoding buffer during read() and write() calls. (cherry picked from commit 73c93265634257b1488262097e024c1727260cfd) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.12] gh-112795: Allow `/` folder in a zipfile (GH-112932) (#113789)Miss Islington (bot)2024-01-071-0/+12
| | | | | | | | | | | gh-112795: Allow `/` folder in a zipfile (GH-112932) Allow extraction (no-op) of a "/" folder in a zipfile, they are commonly added by some archive creation tools. (cherry picked from commit 541c5dbb81c784afd587406be2cc82645979a107) Co-authored-by: AN Long <aisk@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.12] gh-62260: Fix ctypes.Structure subclassing with multiple layers ↵Serhiy Storchaka2024-01-051-1/+63
| | | | | | | | | | | | | | | (GH-13374) (GH-113623) The length field of StgDictObject for Structure class contains now the total number of items in ffi_type_pointer.elements (excluding the trailing null). The old behavior of using the number of elements in the parent class can cause the array to be truncated when it is copied, especially when there are multiple layers of subclassing. (cherry picked from commit 5f3cc90a12d6df404fd6f48a0df1334902e271f2) Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>
* [3.12] gh-110190: Fix ctypes structs with array on PPCLE64 (GH-112959) (#113170)Diego Russo2024-01-051-148/+84
| | | | | | | Fix the same issue of PR #112604 on PPC64LE platform Refactor tests to make easier to add more platfroms if needed. (cherry picked from commit 6644ca45cde9ca1b80513a90dacccfeea2d98620) Change-Id: I31730a3ebe558570ce1d7a3b26db8392f18d1770
* [3.12] gh-113703: Correctly identify incomplete f-strings in the codeop ↵Pablo Galindo Salgado2024-01-051-0/+3
| | | | | module (GH-113709) (#113733) (cherry picked from commit 3003fbbf00422bce6e327646063e97470afa9091)
* [3.12] gh-113320: Reduce the number of dangerous `getattr()` calls when ↵Alex Waygood2024-01-051-2/+36
| | | | | | | | | constructing protocol classes (#113401) (#113722) - Only attempt to figure out whether protocol members are "method members" or not if the class is marked as a runtime protocol. This information is irrelevant for non-runtime protocols; we can safely skip the risky introspection for them. - Only do the risky getattr() calls in one place (the runtime_checkable class decorator), rather than in three places (_ProtocolMeta.__init__, _ProtocolMeta.__instancecheck__ and _ProtocolMeta.__subclasscheck__). This reduces the number of locations in typing.py where the risky introspection could go wrong. - For runtime protocols, if determining whether a protocol member is callable or not fails, give a better error message. I think it's reasonable for us to reject runtime protocols that have members which raise strange exceptions when you try to access them. PEP-544 clearly states that all protocol member must be callable for issubclass() calls against the protocol to be valid -- and if a member raises when we try to access it, there's no way for us to figure out whether it's a callable member or not! (cherry-picked from commit ed6ea3ea79)
* [3.12] gh-113538: Don't error in stream reader protocol callback when task ↵Miss Islington (bot)2024-01-041-7/+13
| | | | | | | is cancelled (GH-113690) (#113713) (cherry picked from commit 4681a5271a8598b46021cbc556ac8098ab8a1d81) Co-authored-by: Guido van Rossum <guido@python.org>
* [3.12] gh-113628: Fix test_site test with long stdlib paths (GH-113640) ↵Miss Islington (bot)2024-01-031-22/+21
| | | | | | | | (#113671) gh-113628: Fix test_site test with long stdlib paths (GH-113640) (cherry picked from commit 5dc79e3d7f26a6a871a89ce3efc9f1bcee7bb447) Co-authored-by: Itamar Oren <itamarost@gmail.com>