summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* [3.8] bpo-42967: only use '&' as a query string separator (GH-24297) (#24529)Senthil Kumaran2021-02-152-27/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-42967: only use '&' as a query string separator (#24297) bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl(). urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator. Co-authored-by: Éric Araujo <merwok@netwok.org> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Éric Araujo <merwok@netwok.org> (cherry picked from commit fcbe0cb04d35189401c0c880ebfb4311e952d776) * [3.8] bpo-42967: only use '&' as a query string separator (GH-24297) bpo-42967: [security] Address a web cache-poisoning issue reported in urllib.parse.parse_qsl(). urllib.parse will only us "&" as query string separator by default instead of both ";" and "&" as allowed in earlier versions. An optional argument seperator with default value "&" is added to specify the separator. Co-authored-by: Éric Araujo <merwok@netwok.org> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Éric Araujo <merwok@netwok.org>. (cherry picked from commit fcbe0cb04d35189401c0c880ebfb4311e952d776) Co-authored-by: Adam Goldschmidt <adamgold7@gmail.com> * Update correct version information. * fix docs and make logic clearer Co-authored-by: Adam Goldschmidt <adamgold7@gmail.com> Co-authored-by: Fidget-Spinner <28750310+Fidget-Spinner@users.noreply.github.com>
* bpo-41748: Handles unquoted attributes with commas (GH-24072)Miss Islington (bot)2021-02-011-36/+56
| | | | | | | | | | | | | | | | | | | | | * bpo-41748: Adds tests for unquoted attributes with comma * bpo-41748: Handles unquoted attributes with comma * bpo-41748: Addresses review comments * bpo-41748: Addresses review comments * Adds more test cases * Simplifies the regex for handling spaces * bpo-41748: Moves attributes tests under the right class * bpo-41748: Addresses review about duplicate attributes * bpo-41748: Adds NEWS.d entry for this patch (cherry picked from commit 9eb11a139fac5514d8456626806a68b3e3b7eafb) Co-authored-by: Karl Dubost <karl+github@la-grange.net>
* bpo-43016: Fix test_curses on platform without cursesw (GH-24405) (GH-24408)Miss Islington (bot)2021-02-011-5/+23
| | | | | | (cherry picked from commit a1e9a1e120a11c563e166c15721169184c802f8b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.8] bpo-43016: Rewrite tests for curses (GH-24312). (GH-24399) (GH-24401)Serhiy Storchaka2021-01-311-214/+771
| | | | | (cherry picked from commit d64fd4bb5bb4fd2e3277f39d3ad99b5a8d193e1b). (cherry picked from commit e9d4960d15c5282904cf26e469ce7cee39f634f7)
* [3.8] bpo-42383: pdb: do not fail to restart the target if the current ↵Andrey Bienkowski2021-01-261-0/+23
| | | | directory changed (GH-23412) (#24323)
* [3.8] bpo-42384: pdb: correctly populate sys.path[0] (GH-23338) (#24320)Andrey Bienkowski2021-01-251-0/+42
|
* bpo-42780: Fix set_inheritable() for O_PATH file descriptors on Linux ↵cptpcrd2021-01-211-0/+27
| | | | | (GH-24172) (GH-24277) (cherry picked from commit 7dc71c425cf6aa6a4070a418dce5d95ca435c79f)
* [3.8] bpo-42531: Teach importlib.resources.path to handle packages without ↵William Schwartz2021-01-161-0/+12
| | | | | | | | | __file__ (GH-23611) Fixes [bpo-42531]() for Python 3.8. The issue also applies to 3.7. If this PR looks like it'll be accepted, I can cherry-pick it to the 3.7 branch and submit a follow-up PR. Automerge-Triggered-By: GH:jaraco
* [3.8] [3.9] bpo-42681: Fix test_curses failures related to color pairs ↵Serhiy Storchaka2021-01-051-7/+26
| | | | | | | | | | (GH-24089) (GH-24113) (GH-24116) On ncurses 6.1 pair numbers are limited by SHORT_MAX-1. Improve error reporting and tests for color functions. (cherry picked from commit 59f9b4e4509be67494f3d45489fa55523175ff69) (cherry picked from commit 9b3a53a8264d4c469a3f3d8c037e74c010be3e5c)
* [3.8] [3.9] bpo-42681: Fix range checks for color and pair numbers in curses ↵Serhiy Storchaka2021-01-041-14/+119
| | | | | | | (GH-23874). (GH-24077) (GH-24079) (cherry picked from commit 1470edd6131c29b8a09ce012cdfee3afa269d553) (cherry picked from commit b0ee2b492dbf550fbd2a63b82de0a4dc9d67f32e)
* [3.8] [3.9] bpo-42789: Don't skip curses tests on non-tty. (GH-24009) ↵Serhiy Storchaka2021-01-031-39/+63
| | | | | | | | | | | (GH-24076) (GH-24078) If __stdout__ is not attached to terminal, try to use __stderr__ if it is attached to terminal, or open the terminal device, or use regular file as terminal, but some functions will be untested in the latter case. (cherry picked from commit 607501abb488fb37e33cf9d35260ab7baefa192f) (cherry picked from commit 0303008ebceb6ac6035cd9722d1393267304171d)
* bpo-42809: Improve pickle tests for recursive data. (GH-24060)Miss Islington (bot)2021-01-021-87/+253
| | | | | (cherry picked from commit a25011be8c6f62cb3333903befe6295d57f0bd30) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.8] bpo-26407: Do not mask errors in csv. (GH-20536) (GH-24021)Serhiy Storchaka2021-01-011-1/+19
| | | | | | | Unexpected errors in calling the __iter__ method are no longer masked by TypeError in csv.reader(), csv.writer.writerow() and csv.writer.writerows(). (cherry picked from commit c88239f864a27f673c0f0a9e62d2488563f9d081)
* bpo-42794: Update test_nntplib to use offical group name for testing (GH-24037)Miss Islington (bot)2021-01-011-3/+7
| | | | | (cherry picked from commit ec3165320e81ac87edcb85c86c452528ddbaec1c) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* Allow / character in username,password fields in _PROXY envvars. (GH-23973) ↵Miss Islington (bot)2020-12-291-1/+9
| | | | | | | (#23992) (cherry picked from commit 030a713183084594659aefd77b76fe30178e23c8) Co-authored-by: Senthil Kumaran <senthil@uthcode.com>
* bpo-42749: Use dynamic version to test for unsupported bignum in Tk (GH-23966)Miss Islington (bot)2020-12-291-1/+1
| | | | | | | Tk can internally support bignum even if Tkinter is built without support of bignum. (cherry picked from commit 156b7f7052102ee1633a18e9a136ad8c38f66db0) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-42749: Fix testing bignum if Tkinter is compiled with Tk 8.4 and dynamic ↵Miss Islington (bot)2020-12-271-4/+8
| | | | | | | | linked with Tk >= 8.5 (GH-23955) (GH-23962) (cherry picked from commit b02ad2458bc127a7afdeef414fa68c9a7f1f32af) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.8] bpo-42318: Fix support of non-BMP characters in Tkinter on macOS ↵Miss Islington (bot)2020-12-251-6/+40
| | | | | | | (GH-23281). (GH-23784) (GH-23787) (cherry picked from commit a26215db11cfcf7b5f55cab9e91396761a0e0bcf) (cherry picked from commit 28bf6ab61f77c69b732a211c398ac882bf3f65f4)
* bpo-42734: Fix crasher bogus_code_obj.py (GH-23939)Miss Islington (bot)2020-12-251-1/+1
| | | | | | | It did not work because the signature of code object constructor was changed. Also, it used old format of bytecode (pre-wordcode). (cherry picked from commit 954a7427ba9c2d02faed32c02090caeca873aeca) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-42388: Fix subprocess.check_output input=None when text=True (GH-23467)Miss Islington (bot)2020-12-251-0/+22
| | | | | | | | | | | | | When the modern text= spelling of the universal_newlines= parameter was added for Python 3.7, check_output's special case around input=None was overlooked. So it behaved differently with universal_newlines=True vs text=True. This reconciles the behavior to be consistent and adds a test to guarantee it. Also clarifies the existing check_output documentation. Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru> (cherry picked from commit 64abf373444944a240274a9b6d66d1cb01ecfcdd) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [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>