summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-44483: Fix crash in union object with bad ``__module__`` (GH-26848) ↵Miss Islington (bot)2021-06-231-0/+9
| | | | | | | | (GH-26852) (cherry picked from commit adfa1ba398c74720b42f16f06fd3ec0353599fa5) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* bpo-44439: BZ2File.write() / LZMAFile.write() handle buffer protocol ↵Miss Islington (bot)2021-06-223-0/+27
| | | | | | | | | | correctly (GH-26764) (GH-26845) No longer use len() to get the length of the input data. For some buffer protocol objects, the length obtained by using len() is wrong. (cherry picked from commit bc6c12c72a9536acc96e7b9355fd69d1083a43c1) Co-authored-by: Ma Lin <animalize@users.noreply.github.com>
* bpo-44287: asyncio test_popen() uses longer timeout (GH-26832)Miss Islington (bot)2021-06-221-1/+2
| | | | | | | | | | | Fix asyncio test_popen() of test_windows_utils by using a longer timeout. Use military grade battle-tested test.support.SHORT_TIMEOUT timeout rather than a hardcoded timeout of 10 seconds: it's 30 seconds by default, but it is made longer on slow buildbots. WaitForMultipleObjects() timeout argument is in milliseconds. (cherry picked from commit be1cb3214d09d4bf0288bc45f3c1f167f67e4514) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-44395: Fix MIMEPart.as_string to pass unixfrom properly (GH-26685)Miss Islington (bot)2021-06-211-0/+7
| | | | | (cherry picked from commit 30f7a77f359a0fc6e37988b0f317a77a15d66b7b) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* bpo-44466: Faulthandler now detects the GC (GH-26823) (GH-26826)Victor Stinner2021-06-211-14/+53
| | | | | | The faulthandler module now detects if a fatal error occurs during a garbage collector collection (only if all_threads is true). (cherry picked from commit d19163912bfc790283724f05328bd31e4e65003d)
* bpo-44297: Fix missing line number in generator expressions (GH-26821)Mark Shannon2021-06-211-0/+15
| | | | | * Make sure that line number is set when entering comprehension scope in compiler. (cherry picked from commit 82e5c28af7049c4f5343c808f172cbe2e145f49b)
* bpo-44469: Fix tests for "async with" with bad object (GH-26817)Miss Islington (bot)2021-06-211-6/+12
| | | | | | | Test for execution of the body was null. It would pass even if the code which should be skipped was executed. (cherry picked from commit 5d2b3a0d688cf8a33db3d266c9e7049c13766a4c) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.10] bpo-43945: [Enum] reduce scope of new format() behavior (GH-26752) Ethan Furman2021-06-182-20/+163
| | | | | | | | | | | | | | | | | | | | | | | | | * [Enum] reduce scope of new format behavior Instead of treating all Enums the same for format(), only user mixed-in enums will be affected. In other words, IntEnum and IntFlag will not be changing the format() behavior, due to the requirement that they be drop-in replacements of existing integer constants. If a user creates their own integer-based enum, then the new behavior will apply: class Grades(int, Enum): A = 5 B = 4 C = 3 D = 2 F = 0 Now: format(Grades.B) -> DeprecationWarning and '4' 3.12: -> no warning, and 'B'. (cherry picked from commit f60b07ab6c943fce084772c3c7731ab3bbd213ff) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* [3.10] bpo-44368: Improve syntax errors with invalid as pattern targets ↵Pablo Galindo2021-06-181-0/+14
| | | | | | | (GH-26632) (GH-26792) (cherry picked from commit 05073036dcecefc00b0c3e7397601809da41e2f1) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-44451: Reset DeprecationWarning filters in ↵Miss Islington (bot)2021-06-181-0/+1
| | | | | | | | | | | | | | | | | | | | test_importlib.test_entry_points_by_index (GH-26784) This avoids the following error if DeprecationWarnings are ignored. ====================================================================== ERROR: test_entry_points_by_index (test.test_importlib.test_metadata_api.APITests) Prior versions of Distribution.entry_points would return a ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Python-3.10.0b3/Lib/test/test_importlib/test_metadata_api.py", line 145, in test_entry_points_by_index expected = next(iter(caught)) StopIteration ---------------------------------------------------------------------- Ran 1402 tests in 2.125s FAILED (errors=1, skipped=18, expected failures=1) (cherry picked from commit df1502e47fc1e0cf1e7d460ae04530c3e2e4a7c6) Co-authored-by: Miro Hrončok <miro@hroncok.cz>
* [3.10] Reorganize the pattern matching suite (GH-26661) (GH-26787)Miss Islington (bot)2021-06-181-548/+497
| | | | | | | | (cherry picked from commit c106cf31f816f719de0a83ff31b9f4d0bea3519b) Co-authored-by: Brandt Bucher <brandt@python.org> Automerge-Triggered-By: GH:brandtbucher
* bpo-43024: improve signature (in help, etc) for functions taking sent… ↵Miss Islington (bot)2021-06-171-0/+16
| | | | | | | | (GH-24331) (GH-26773) …inel defaults (cherry picked from commit f73377d57c5272390de63cccc3c292c44689310a) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* bpo-44389: Fix typo in ssl deprecation warning message (GH-26754)Miss Islington (bot)2021-06-171-1/+1
| | | | | | `ssl.SSL_NO_TLS` should be `ssl.OP_NO_TLS`. (cherry picked from commit c544393b89f9b3e2b1a22588fc9ae58019314879) Co-authored-by: Joe <nigelchiang@outlook.com>
* [3.10] bpo-44342: [Enum] improve test, add andrei kulakov to ACKS (GH-26726)Ethan Furman2021-06-161-2/+25
| | | | | | * [3.10] [Enum] improve test, add andrei kulakov to ACKS (GH-26726). (cherry picked from commit cb2014f2077c92c35486bf0db7e646a68478a7a5) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* bpo-44342: [Enum] fix data type search (GH-26667)Miss Islington (bot)2021-06-151-0/+8
| | | | | | | | | | | | In an inheritance chain of int -> my_int -> final_int the data type is now final_int (not my_int) (cherry picked from commit 3a7cccfd6cd3693e1a2ab65ee05d7f45f8501dfa) Co-authored-by: Ethan Furman <ethan@stoneleaf.us> Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* bpo-44409: Fix error location in tokenizer errors that happen during ↵Miss Islington (bot)2021-06-141-0/+1
| | | | | | | initialization (GH-26712) (cherry picked from commit 507ed6fa1d6661e0f8e6d3282764aa9625a99594) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-43425: Update test_c_parser not to use TempdirManager (GH-26693)Miss Islington (bot)2021-06-141-5/+8
| | | | | (cherry picked from commit 736ed6f7a9f465ba728198e8bca81e5fbe71bc37) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* bpo-43475: Fix the Python implementation of hash of Decimal NaN (GH-26679)Miss Islington (bot)2021-06-132-8/+34
| | | | | (cherry picked from commit 9f1c5f6e8af6ba3f659b2aea1e221ac9695828ba) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.10] bpo-44389: Fix deprecation of OP_NO_TLSv1_3 (GH-26700) (GH-26705)Miss Islington (bot)2021-06-131-8/+56
| | | | | | | | | Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit bf527277d4e4907e32d76ca7ba667ab3149fe258) Co-authored-by: Christian Heimes <christian@python.org> Automerge-Triggered-By: GH:tiran
* bpo-44396: Update multi-line-start location when reallocating tokenizer ↵Miss Islington (bot)2021-06-121-0/+7
| | | | | | buffers (GH-26676) (GH-26695) Automerge-Triggered-By: GH:pablogsal (cherry picked from commit a342cc5891dbd8a08d40e9444f2e2c9e93258721)
* bpo-43318: Fix a bug where pdb does not always echo cleared breakpoints ↵Miss Islington (bot)2021-06-111-0/+29
| | | | | | | (GH-24646) (GH-26674) (cherry picked from commit 4cb6ba14325cff98589c2660d1d2c65f4aacfee4) Co-authored-by: huzhaojie <hu.zj@foxmail.com>
* bpo-44242: [Enum] improve error messages (GH-26669)Miss Islington (bot)2021-06-111-7/+5
| | | | | | | (cherry picked from commit c956734d7af83ad31f847d31d0d26df087add9a4) Co-authored-by: Ethan Furman <ethan@stoneleaf.us> Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* bpo-44362: ssl: improve deprecation warnings and docs (GH-26646)Miss Islington (bot)2021-06-111-7/+12
| | | | | | Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit e26014f1c47d26d6097ff7a0f25384bfbde714a9) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-44342: [Enum] changed pickling from by-value to by-name (GH-26658) ↵Miss Islington (bot)2021-06-101-4/+4
| | | | | | | | | | | | | | (GH-26660) by-value lookups could fail on complex enums, necessitating a check for __reduce__ and possibly sabotaging the final enum; by-name lookups should never fail, and sabotaging is no longer necessary for class-based enum creation. (cherry picked from commit 62f1d2b3d7dda99598d053e10b785c463fdcf591) Co-authored-by: Ethan Furman <ethan@stoneleaf.us> Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* bpo-44356: [Enum] allow multiple data-type mixins if they are all the same ↵Miss Islington (bot)2021-06-101-0/+47
| | | | | | | | | | | | | | | | | | | (GH-26649) (GH-26653) This enables, for example, two base Enums to both inherit from `str`, and then both be mixed into the same final Enum: class Str1Enum(str, Enum): GH- some behavior here class Str2Enum(str, Enum): GH- some more behavior here class FinalStrEnum(Str1Enum, Str2Enum): GH- this now works (cherry picked from commit 8a4f0850d75747af8c96ca0e7eef1f5c1abfba25) Co-authored-by: Ethan Furman <ethan@stoneleaf.us> Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* bpo-37022: Fix bug where pdb's do_p/do_pp commands swallow exceptions from ↵Miss Islington (bot)2021-06-101-0/+28
| | | | | | | | repr (GH-18180) (GH-26650) (cherry picked from commit 6544b2532df82d137b71323445a07a6e29bcdec0) Co-authored-by: Daniel Hahler <git@thequod.de>
* [3.10] bpo-44242: [Enum] remove missing bits test from Flag creation ↵Ethan Furman2021-06-101-15/+129
| | | | | | | | | | (GH-26586) (GH-26635) Move the check for missing named flags in flag aliases from Flag creation to a new *verify* decorator.. (cherry picked from commit eea8148b7dff5ffc7b84433859ac819b1d92a74d) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
* bpo-44368: Ensure we don't raise incorrect custom syntax errors with soft ↵Miss Islington (bot)2021-06-092-1/+20
| | | | | | | keywords (GH-26630) (cherry picked from commit 457ce60fc70f1c9290023f46fb82b6a490dff32e) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-44349: Fix edge case when displaying text from files with encoding in ↵Miss Islington (bot)2021-06-091-0/+16
| | | | | | | | | syntax errors (GH-26611) (GH-26616) (cherry picked from commit 9fd21f649d66dcb10108ee395fd68ed32c8239cd) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-43833: Emit warnings for numeric literals followed by keyword (GH-25466)Miss Islington (bot)2021-06-082-3/+91
| | | | | | | | | | | Emit a deprecation warning if the numeric literal is immediately followed by one of keywords: and, else, for, if, in, is, or. Raise a syntax error with more informative message if it is immediately followed by other keyword or identifier. Automerge-Triggered-By: GH:pablogsal (cherry picked from commit 2ea6d890281c415e0a2f00e63526e592da8ce3d9) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.10] bpo-11105: reduce the recursion limit for tests. (GH-26607)Batuhan Taskaya2021-06-082-2/+14
| | | | | (cherry picked from commit e58d762c1fb4ad5e021d016c80c2bc4513632d2f) Co-authored-by: Batuhan Taskaya <batuhan@python.org>
* bpo-44335: Fix a regression when identifying invalid characters in syntax ↵Miss Islington (bot)2021-06-081-0/+1
| | | | | | | errors (GH-26589) (cherry picked from commit d334c73b56756e90c33ce06e3a6ec23271aa099d) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* fix: use unambiguous punction in 'invalid escape sequence' message (GH-26582)Miss Islington (bot)2021-06-081-1/+1
| | | | | (cherry picked from commit ffd87b7093109c279caf8e3ca060f408a102388a) Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
* bpo-38323: Skip SubprocessMultiLoopWatcherTest as they can hang the test ↵Miss Islington (bot)2021-06-051-0/+2
| | | | | | | | | suite (GH-26542) (GH-26544) (cherry picked from commit f171877ebe276749f31386baed5841ce37cbee2e) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-44048: Fix two hashlib test cases under FIPS mode (GH-26470) (GH-26531)Miss Islington (bot)2021-06-041-2/+10
| | | | | | | | | | test_disallow_instantiation and test_readonly_types try to test all the available digests, however under FIPS mode, while the algorithms are available, trying to use them will fail with a ValueError. (cherry picked from commit a46c220edc5cf716d0b71eb80ac29ecdb4ebb430) Co-authored-by: stratakis <cstratak@redhat.com> Co-authored-by: stratakis <cstratak@redhat.com>
* [3.10] bpo-44305: Improve syntax error for try blocks without except or ↵Pablo Galindo2021-06-031-0/+8
| | | | | | | finally (GH-26523) (GH-26524) (cherry picked from commit b250f89bb7e05e72a4641d44b988866b919575db) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* [3.10] bpo-44273: Improve syntax error message for assigning to "..." ↵Pablo Galindo2021-06-031-1/+1
| | | | | | | | | | (GH-26477) (GH-26478) Use "ellipsis" instead of "Ellipsis" in syntax error messages to eliminate confusion with built-in variable Ellipsis. (cherry picked from commit 39dd141) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-11105: Do not crash when compiling recursive ASTs (GH-20594)Miss Islington (bot)2021-06-031-0/+14
| | | | | | | | | | When compiling an AST object with a direct / indirect reference cycles, on the conversion phase because of exceeding amount of calls, a segfault was raised. This patch adds recursion guards to places for preventing user inputs to not to crash AST but instead raise a RecursionError. (cherry picked from commit f3491242e41933aa9529add7102edb68b80a25e9) Co-authored-by: Batuhan Taskaya <batuhan@python.org>
* bpo-43921: Fix test_ssl.test_wrong_cert_tls13() on Windows (GH-26502) (GH-26518)Miss Islington (bot)2021-06-031-14/+6
| | | | | | | Fix test_ssl.test_wrong_cert_tls13(): use suppress_ragged_eofs=False, since read() can raise ssl.SSLEOFError on Windows. (cherry picked from commit ea0210fa8ccca769896847f25fc6fadfe9a717bc) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.10] bpo-44298: Backport #26513 to 3.10 (#26516)Mark Shannon2021-06-031-0/+46
| | | | | * Backport 937cebc93 to 3.10 * Update importlib
* bpo-44022: Improve the regression test. (GH-26503)Miss Islington (bot)2021-06-031-1/+6
| | | | | | | It wasn't actually detecting the regression due to the assertion being too lenient. (cherry picked from commit e60ab843cbb016fb6ff8b4f418641ac05a9b2fcc) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* bpo-43921: Fix test_ssl.test_pha_required_nocert() (GH-26489)Miss Islington (bot)2021-06-021-2/+9
| | | | | | | Fix test_pha_required_nocert() of test_ssl: catch two more EOF cases (when the recv() method returns an empty string). (cherry picked from commit 320eaa7f42b413cd5e5436ec92d4dc5ba150395f) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.10] bpo-44246: Restore compatibility in entry_points (GH-26468) (GH-26471)Miss Islington (bot)2021-05-311-0/+16
| | | | | | | | | | | | | * [bpo-44246](): Entry points performance improvements. From importlib_metadata 4.3.1. * [bpo-44246](): Sync with importlib_metadata 4.4 (cherry picked from commit c34ed08d975fb7daa7b329f7c631647782290393) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> Automerge-Triggered-By: GH:jaraco
* bpo-44246: Entry points performance improvements. (GH-26467)Miss Islington (bot)2021-05-311-0/+4
| | | | | | From importlib_metadata 4.3.1. (cherry picked from commit 410b70d39d9d77384f8b8597560f6731530149ca) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* bpo-38693: Prefer f-strings in importlib.resources (importlib_resources ↵Miss Islington (bot)2021-05-262-3/+3
| | | | | | | | | | 5.0.6). (GH-26387) (#26389) Automerge-Triggered-By: GH:jaraco (cherry picked from commit f6fbdb90ee450ad693f7a7809035d0dc968f98b7) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* bpo-44232: Fix type_new() error reporting (GH-26359) (GH-26365)Miss Islington (bot)2021-05-261-0/+18
| | | | | | | | | Fix a regression in type() when a metaclass raises an exception. The C function type_new() must properly report the exception when a metaclass constructor raises an exception and the winner class is not the metaclass. (cherry picked from commit bd199e72fb60a8ff001a023f23925092a290be91) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-44151: linear_regression() minor API improvements (GH-26199) (GH-26338)Miss Islington (bot)2021-05-251-1/+1
|
* bpo-44184: Fix subtype_dealloc() for freed type (GH-26274) (GH-26290)Miss Islington (bot)2021-05-211-1/+33
| | | | | | | | | | | | | | Fix a crash at Python exit when a deallocator function removes the last strong reference to a heap type. Don't read type memory after calling basedealloc() since basedealloc() can deallocate the type and free its memory. _PyMem_IsPtrFreed() argument is now constant. (cherry picked from commit 615069eb08494d089bf24e43547fbc482ed699b8) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-44180: Fix edge cases in invalid assigment rules in the parser (GH-26283)Miss Islington (bot)2021-05-211-0/+20
| | | | | | | | | | | | | | | | | | The invalid assignment rules are very delicate since the parser can easily raise an invalid assignment when a keyword argument is provided. As they are very deep into the grammar tree, is very difficult to specify in which contexts these rules can be used and in which don't. For that, we need to use a different version of the rule that doesn't do error checking in those situations where we don't want the rule to raise (keyword arguments and generator expressions). We also need to check if we are in left-recursive rule, as those can try to eagerly advance the parser even if the parse will fail at the end of the expression. Failing to do this allows the parser to start parsing a call as a tuple and incorrectly identify a keyword argument as an invalid assignment, before it realizes that it was not a tuple after all. (cherry picked from commit c878a9796841c1f4726e6dd5ac49a478af4c8504) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* [3.10] bpo-43643: Sync with python/importlib_resources@c17a610aad. ↵Miss Islington (bot)2021-05-211-0/+6
| | | | | | | | | | | | (GH-26284) (GH-26286) * [bpo-43643](): Sync with python/importlib_resources@c17a610aad. * Sync with python/importlib_resources@89fd5e961a. (cherry picked from commit 875b3d84b3072b2d3c352ad9f0ff52c441fbd12e) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> Automerge-Triggered-By: GH:jaraco