summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* [3.8] bpo-42630: Improve error reporting in Tkinter for absent default root ↵Serhiy Storchaka2020-12-191-1/+1
| | | | | | | | | | | | | | | (GH-23781) (GH-23854) * Tkinter functions and constructors which need a default root window raise now RuntimeError with descriptive message instead of obscure AttributeError or NameError if it is not created yet or cannot be created automatically. * Add tests for all functions which use default root window. * Fix import in the pynche script. (cherry picked from commit 3d569fd6dccf9f582bafaca04d3535094cae393e)
* bpo-41891: ensure asyncio.wait_for waits for task completion (GH-22461)Miss Islington (bot)2020-12-181-0/+61
| | | | | (cherry picked from commit 17ef4319a34f5a2f95e7823dfb5f5b8cff11882d) Co-authored-by: Richard Kojedzinszky <rkojedzinszky@users.noreply.github.com>
* bpo-41804: Enhance test_epoll.test_control_and_wait() (GH-23795) (GH-23814)Miss Islington (bot)2020-12-171-13/+11
| | | | | | | | Use shorter timeout and replace send() with sendall(). (cherry picked from commit 79782fe4f8cf73d7fdf8db02073bbadf7ff817b6) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-42644: Validate values in logging.disable() (GH-23786)Miss Islington (bot)2020-12-161-0/+9
| | | | | | | | | | | | | | | | | | | | | | * bpo-42644: Validate values in logging.disable() Technically make the value of manager a property that checks and convert values assigned to it properly. This has the side effect of making `logging.disable` also accept strings representing the various level of warnings. We want to validate the type of the disable attribute at assignment time, as it is later compared to other levels when emitting warnings and would generate a `TypeError: '>=' not supported between ....` in a different part of the code base, which can make it difficult to track down. When assigned an incorrect value; it will raise a TypeError when the wrong type, or ValueError if an invalid str. Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com> (cherry picked from commit b32d8b4f9bcd2e7d11240b6b9de0262cf8f5e09d) Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
* bpo-40084: [Enum] dir() includes member attributes (GH-19219) (GH-22853)Miss Islington (bot)2020-12-092-1/+17
| | | | | (cherry picked from commit 68526fe258da8c01196fd7cf48e8e5f1280bf8fd) Co-authored-by: Angelin BOOZ <9497359+lem2clide@users.noreply.github.com>
* [3.8] [Enum] reformat and add doc strings (GH-23705). (GH-23706)Ethan Furman2020-12-081-1/+0
| | | * [3.8] [Enum] reformat and add doc strings (GH-23705).
* bpo-41907: [Enum] fix format() behavior for IntFlag (GH-22497) (GH-23704)Miss Islington (bot)2020-12-081-0/+14
| | | (cherry picked from commit 37440eef7f9a0c27e13fc9ce0850574bb00688b0)
* bpo-41889: [Enum] fix multiple-inheritance regression (GH-22487) (GH-23672)Miss Islington (bot)2020-12-071-0/+26
| | | (cherry picked from commit c266736ec1f9ebef38b134ceb4832df015711b38)
* bpo-42536: GC track recycled tuples (GH-23623) (GH-23652)Brandt Bucher2020-12-075-1/+104
| | | | | | | | | | | | | | | | | Several built-in and standard library types now ensure that their internal result tuples are always tracked by the garbage collector: - collections.OrderedDict.items - dict.items - enumerate - functools.reduce - itertools.combinations - itertools.combinations_with_replacement - itertools.permutations - itertools.product - itertools.zip_longest - zip Previously, they could have become untracked by a prior garbage collection. (cherry picked from commit 226a012d1cd61f42ecd3056c554922f359a1a35d)
* bpo-39825: Fixes sysconfig.get_config_var('EXT_SUFFIX') on Windows to match ↵Miss Islington (bot)2020-12-071-1/+3
| | | | | | | distutils (GH-22088) (cherry picked from commit c0afb7fa0ebd1c0e95c0760bbe75a99a8dd12ea6) Co-authored-by: Matti Picus <matti.picus@gmail.com>
* bpo-17735: inspect.findsource now raises OSError when co_lineno is out of ↵Miss Islington (bot)2020-12-041-0/+11
| | | | | | | | range (GH-23633) This can happen when a file was edited after it was imported. (cherry picked from commit 2e0760bb2edb595050aff82f236cd32b44d3dfb3) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
* bpo-42116: Fix inspect.getsource handling of trailing comments (GH-23630)Miss Islington (bot)2020-12-042-4/+41
| | | | | (cherry picked from commit 6e1eec71f59c344fb23c7977061dc2c97b77d51b) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
* bpo-41473: Reenable test_gdb on gdb 9.2 and newer (GH-23637)Miss Islington (bot)2020-12-041-5/+0
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1866884 is fixed in gdb 10.1 (failed to reproduce on gdb-10.1-1.fc34.aarch64). (cherry picked from commit 066394018a8463643cc63d933493f0afa99d72cc) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-42553: Fix test_asyncio.test_call_later() (GH-23627)Miss Islington (bot)2020-12-031-3/+0
| | | | | | | | Fix test_asyncio.test_call_later() race condition: don't measure asyncio performance in the call_later() unit test. The test failed randomly on the CI. (cherry picked from commit 7e5e13d113798117d5ef25c5ffdbd0eb39420f98) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-42482: remove reference to exc_traceback from TracebackException (GH-23531)Miss Islington (bot)2020-12-011-0/+22
| | | | | (cherry picked from commit 427613f005f0f412d12f0d775d2b609bae0ae1ad) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
* [3.8] bpo-42474: test TracebackException comparison to non-equal instances ↵Irit Katriel2020-11-301-1/+51
| | | | (GH-23558)
* bpo-34215: Clarify IncompleteReadError message when "expected" is None ↵Miss Islington (bot)2020-11-281-3/+5
| | | | | | | (GH-21925) (#23540) Co-Authored-By: Tyler Bell <mrbell321@gmail.com> (cherry picked from commit 8085f742f4adfbc85f13fc734dfab036aa23acfb) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-12800: tarfile: Restore fix from 011525ee9 (GH-21409)Miss Islington (bot)2020-11-251-3/+3
| | | | | | Restore fix from 011525ee92eb1c13ad1a62d28725a840e28f8160. (cherry picked from commit 4fedd7123eaf147edd55eabbbd72e0bcc8368e47) Co-authored-by: Julien Palard <julien@palard.fr>
* bpo-42398: Fix "make regen-all" race condition (GH-23362) (GH-23367)Miss Islington (bot)2020-11-181-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a race condition in "make regen-all" when make -jN option is used to run jobs in parallel. The clinic.py script now only use atomic write to write files. Moveover, generated files are now left unchanged if the content does not change, to not change the file modification time. The "make regen-all" command runs "make clinic" and "make regen-importlib" targets: * "make regen-importlib" builds object files (ex: Modules/_weakref.o) from source files (ex: Modules/_weakref.c) and clinic files (ex: Modules/clinic/_weakref.c.h) * "make clinic" always rewrites all clinic files (ex: Modules/clinic/_weakref.c.h) Since there is no dependency between "clinic" and "regen-importlib" Makefile targets, these two targets can be run in parallel. Moreover, half of clinic.py file writes are not atomic and so there is a race condition when "make regen-all" runs jobs in parallel using make -jN option (which can be passed in MAKEFLAGS environment variable). Fix clinic.py to make all file writes atomic: * Add write_file() function to ensure that all file writes are atomic: write into a temporary file and then use os.replace(). * Moreover, write_file() doesn't recreate or modify the file if the content does not change to avoid modifying the file modification file. * Update test_clinic to verify these assertions with a functional test. * Remove Clinic.force attribute which was no longer used, whereas Clinic.verify remains useful. (cherry picked from commit 8fba9523cf08029dc2e280d9f48fdd57ab178c9d) (cherry picked from commit c53c3f400050a7edc92ccb7285a6d7eeb4c37fd2) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-41561: skip test_min_max_version_mismatch (GH-22308)Miss Islington (bot)2020-11-181-0/+1
| | | | | | | | skip test_min_max_version_mismatch when TLS 1.0 is not available Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit ce04e7105bc396c32667a22b928a712ba0778a3f) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-42183: Fix a stack overflow error for asyncio Task or Future repr() ↵Miss Islington (bot)2020-11-101-0/+18
| | | | | | | | | | | (GH-23020) The overflow occurs under some circumstances when a task or future recursively returns itself. Co-authored-by: Kyle Stanley <aeros167@gmail.com> (cherry picked from commit 42d873c63aa9d160c132be4a34599531574db12c) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* [3.8] bpo-42103: Improve validation of Plist files. (GH-22882) (GH-23116)Serhiy Storchaka2020-11-031-49/+340
| | | | | | | | | | | * Prevent some possible DoS attacks via providing invalid Plist files with extremely large number of objects or collection sizes. * Raise InvalidFileException for too large bytes and string size instead of returning garbage. * Raise InvalidFileException instead of ValueError for specific invalid datetime (NaN). * Raise InvalidFileException instead of TypeError for non-hashable dict keys. * Add more tests for invalid Plist files. (cherry picked from commit 34637a0ce21e7261b952fbd9d006474cc29b681f)
* bpo-42224: Fix test_format when locale does not expect number grouping ↵Miss Skeleton (bot)2020-11-021-2/+5
| | | | | | | (GH-23067) (cherry picked from commit 301822859b3fc34801a06f1090d62f9f2ee5b092) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* [3.8] bpo-29566: binhex.binhex now consitently writes MacOS 9 line endings. ↵Miss Skeleton (bot)2020-11-011-0/+12
| | | | | | | | | | | (GH-23059) (GH-23070) [[bpo-29566]()]() notes that binhex.binhex uses inconsistent line endings (both Unix and MacOS9 line endings are used). This PR changes this to use the MacOS9 line endings everywhere. (cherry picked from commit 2165cea548f961b308050f30d1f042a377651d44) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com> Automerge-Triggered-By: GH:ronaldoussoren
* [3.8] bpo-40592: shutil.which will not return None anymore if ; is the last ↵Miss Skeleton (bot)2020-10-231-0/+17
| | | | | | | | | | char in PATHEXT (GH-20088) (GH-22913) shutil.which will not return None anymore for empty str in PATHEXT Empty PATHEXT will now be defaulted to _WIN_DEFAULT_PATHEXT (cherry picked from commit da6f098188c9825f10ae60db8987056b3a54c2e8) Co-authored-by: Christopher Marchfelder <marchfelder@googlemail.com>
* bpo-41316: Make tarfile follow specs for FNAME (GH-21511)Miss Skeleton (bot)2020-10-211-1/+13
| | | | | | | | | | | | | tarfile writes full path to FNAME field of GZIP format instead of just basename if user specified absolute path. Some archive viewers may process file incorrectly. Also it creates security issue because anyone can know structure of directories on system and know username or other personal information. RFC1952 says about FNAME: This is the original name of the file being compressed, with any directory components removed. So tarfile must remove directory names from FNAME and write only basename of file. Automerge-Triggered-By: @jaraco (cherry picked from commit 22748a83d927d3da1beaed771be30887c42b2500) Co-authored-by: Artem Bulgakov <ArtemSBulgakov@ya.ru>
* bpo-38324: Fix test__locale.py Windows failures (GH-20529)Miss Skeleton (bot)2020-10-201-0/+4
| | | | | | | Use wide-char _W_* fields of lconv structure on Windows Remove "ps_AF" from test__locale.known_numerics on Windows (cherry picked from commit f2312037e3a974d26ed3e23884f94c6af111a27a) Co-authored-by: TIGirardi <tiagoigirardi@gmail.com>
* bpo-41491: plistlib: accept hexadecimal integer values in xml plist files ↵Miss Skeleton (bot)2020-10-201-0/+13
| | | | | | | | | (GH-22764) (GH-22807) (cherry picked from commit 3185267400be853404f22a1e06bb9fe1210735c7) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com> Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
* bpo-41471: Ignore invalid prefix lengths in system proxy settings on macOS ↵Miss Skeleton (bot)2020-10-201-0/+12
| | | | | | | (GH-22762) (GH-22774) (cherry picked from commit 93a1ccabdede416425473329b8c718d507c55e29) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
* bpo-42051: Reject XML entity declarations in plist files (GH-22760)Miss Skeleton (bot)2020-10-201-0/+18
| | | | | (cherry picked from commit 05ee790f4d1cd8725a90b54268fc1dfe5b4d1fa2) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
* bpo-38912: fix close before connect callback in test_asyncio SSL tests ↵Miss Skeleton (bot)2020-10-201-0/+2
| | | | | | | | (GH-22691) Reduces the rate at which the ENV CHANGED failure occurs in test_asyncio SSL tests (due to unclosed transport), but does not 100% resolve it. (cherry picked from commit de73d432bb29f6439f2db16cb991e15e09c70c26) Co-authored-by: Justin Turner Arthur <justinarthur@gmail.com>
* bpo-27321 Fix email.generator.py to not replace a non-existent header. ↵Miss Skeleton (bot)2020-10-191-0/+35
| | | | | | | | | | | | | | (GH-18074) This PR replaces GH-1977. The reason for the replacement is two-fold. The fix itself is different is that if the CTE header doesn't exist in the original message, it is inserted. This is important because the new CTE could be quoted-printable whereas the original is implicit 8bit. Also the tests are different. The test_nonascii_as_string_without_cte test in GH-1977 doesn't actually test the issue in that it passes without the fix. The test_nonascii_as_string_without_content_type_and_cte test is improved here, and even though it doesn't fail without the fix, it is included for completeness. Automerge-Triggered-By: @warsaw (cherry picked from commit bf838227c35212709dc43b3c3c57f8e1655c1d24) Co-authored-by: Mark Sapiro <mark@msapiro.net>
* bpo-40492: Fix --outfile with relative path when the program changes it ↵Anthony Sottile2020-10-181-1/+15
| | | | | working dir (GH-19910) (cherry picked from commit 3c0ac18504cfeed822439024339d5717f42bdd66)
* [3.8] bpo-32498: Improve exception message on passing bytes to ↵Irit Katriel2020-10-181-0/+6
| | | | urllib.parse.unquote (GH-22746)
* bpo-41966: Fix pickling pure datetime.time subclasses (GH-22731) (GH-22748)Miss Skeleton (bot)2020-10-181-0/+3
| | | | | | (cherry picked from commit c304c9a7efa8751b5bc7526fa95cd5f30aac2b92) Co-authored-by: scaramallion <scaramallion@users.noreply.github.com>
* bpo-42065: Fix incorrectly formatted _codecs.charmap_decode error message ↵Miss Skeleton (bot)2020-10-181-0/+12
| | | | | | | (GH-19940) (cherry picked from commit 3635388f52b42e5280229104747962117104c453) Co-authored-by: Max Bernstein <tekknolagi@users.noreply.github.com>
* [3.8] bpo-41855: Fix duplicate results in FastPath.zip_children() (#22404)Jason R. Coombs2020-10-151-1/+10
| | | | | | | * bpo-41855: Backport fixes from importlib_metadata 1.5.2. * Add blurb. * Add anchor for finders and loaders
* bpo-41984: GC track all user classes (GH-22701/GH-22707)Miss Skeleton (bot)2020-10-152-5/+24
| | | (cherry picked from commit c13b847a6f913b72eeb71651ff626390b738d973)
* bpo-41939: always enable test_site.test_license_exists_at_url (GH-22688)Miss Skeleton (bot)2020-10-141-2/+0
| | | | | (cherry picked from commit 6a48518e8dac3521ff387ee67cdf33783114a257) Co-authored-by: Ned Deily <nad@python.org>
* bpo-41739: Fix test_logging.test_race_between_set_target_and_flush() ↵Miss Skeleton (bot)2020-10-121-8/+13
| | | | | | | | | | | | | | | (GH-22655) (GH-22656) (GH-22662) The test now waits until all threads complete to avoid leaking running threads. Also, use regular threads rather than daemon threads. (cherry picked from commit 13ff396c019d548ba181cf22c6f39309a300723c) (cherry picked from commit f5393dc2a0ced7bf670ebc56b5fd10a3eb328d1a) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-41944: No longer call eval() on content received via HTTP in the CJK ↵Miss Skeleton (bot)2020-10-061-14/+8
| | | | | | | | | codec tests (GH-22566) (GH-22577) (cherry picked from commit 2ef5caa58febc8968e670e39e3d37cf8eef3cab8) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-41939: Fix test_site.test_license_exists_at_url() (GH-22559)Miss Skeleton (bot)2020-10-061-0/+2
| | | | | | | Call urllib.request.urlcleanup() to reset the global urllib.request._opener. (cherry picked from commit 1fce240d6c4b2b2cc17a86e88c65169e15b9feeb) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.8] bpo-41909: Enable previously disabled recursion checks. (GH-22536) ↵Serhiy Storchaka2020-10-041-0/+10
| | | | | | | | | | | | | | | (GH-22551) Enable recursion checks which were disabled when get __bases__ of non-type objects in issubclass() and isinstance() and when intern strings. It fixes a stack overflow when getting __bases__ leads to infinite recursion. Originally recursion checks was disabled for PyDict_GetItem() which silences all errors including the one raised in case of detected recursion and can return incorrect result. But now the code uses PyDict_GetItemWithError() and PyDict_SetDefault() instead. (cherry picked from commit 9ece9cd65cdeb0a1f6e60475bbd0219161c348ac)
* [3.8] bpo-41840: Report module-level globals as both local and global in the ↵Pablo Galindo2020-10-031-2/+16
| | | | | | | symtable module (GH-22391). (GH-22529) (cherry picked from commit fb0a4651f1be4ad936f8277478f73f262d8eeb72) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a ↵Miss Skeleton (bot)2020-10-031-0/+8
| | | | | default namespace was defined. (GH-22474) (GH-22508) (cherry picked from commit 6a412c94b6b68e7e3632562dc7358a12ffd1447f)
* bpo-40105: ZipFile truncate in append mode with shorter comment (GH-19337)Miss Islington (bot)2020-09-281-0/+3
| | | | | (cherry picked from commit ff9147d93b868f0e13b9fe14e2a76c2879f6787b) Co-authored-by: Jan Mazur <16736821+mzr@users.noreply.github.com>
* [3.8] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from ↵Thomas Grainger2020-09-241-6/+86
| | | | | | | | pymain_run_module (GH-21956) (#22398) Closes bpo issue 41602. (cherry picked from commit a68a2ad19c891faa891904b3da537911cc77df21) Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* bpo-41811: create SortKey members using first given value (GH-22316) (GH-22326)Miss Islington (bot)2020-09-191-0/+4
| | | | | (cherry picked from commit ae0d2a33ec05aece939a959d36fcf1df1e210a08) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* [3.8] bpo-39728: Enum: fix duplicate `ValueError` (GH-22277) (GH-22283)Ethan Furman2020-09-171-1/+18
| | | | | | | fix default `_missing_` to return `None` instead of raising a `ValueError` Co-authored-by: Andrey Darascheka <andrei.daraschenka@leverx.com>. (cherry picked from commit c95ad7a91fbd7636f33a098d3b39964ab083bf49) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* _auto_called cleanup (GH-22285)Miss Islington (bot)2020-09-171-0/+11
| | | | | (cherry picked from commit fc23a9483ef0d7c98bea9f82392377d0b6ef7b18) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>