summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-34401: Fix test_gdb for HP GDB version string (GH-20804)Miss Islington (bot)2020-06-111-1/+2
| | | | | | | | | | | The GDB provided by HPE on HP-UX contains a modified version string. Therefore the tests fail. Adapt the regex to match that string. Patch by Michael Osipov. Co-Authored-by: Michael Osipov <michael.osipov@siemens.com> (cherry picked from commit b2dca49ca3769cb60713f5c2b43e5d5bbdc1f9c7) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40826: Fix test_repl.test_close_stdin() on Windows (GH-20779) (GH-20785) ↵Victor Stinner2020-06-104-45/+42
| | | | | | | | | | | | | | | | (GH-20787) test_repl.test_close_stdin() now calls support.suppress_msvcrt_asserts() to fix the test on Windows. * Move suppress_msvcrt_asserts() from test.libregrtest.setup to test.support. Make its verbose parameter optional: verbose=False by default. * SuppressCrashReport now uses SetErrorMode() of the msvcrt module, rather than using ctypes. * Remove also an unused variable (deadline) in wait_process(). (cherry picked from commit f6e58aefde2e57e4cb11ea7743955da53a3f1e80) (cherry picked from commit 4a4f660cfde8b683634c53e6214a6baa51de43b1)
* [3.8] Revert bpo-39576: Prevent memory error for overly optimistic ↵Stefan Krah2020-06-081-35/+0
| | | | | precisions (GH-20747) This reverts commit b6271025c640c228505dc9f194362a0c2ab81c61.
* bpo-40870: Invalidate usage of some constants with ast.Name (GH-20649)Miss Islington (bot)2020-06-061-0/+7
| | | | | (cherry picked from commit 68874a8502da440a1dc4746cf73262648b870aee) Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
* bpo-40614: Respect feature version for f-string debug expressions (GH-20196) ↵Shantanu2020-06-061-0/+6
| | | | | | | (GH-20466) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com> (cherry picked from commit c116c94ff119485761460f1033cdee425bed0310)
* bpo-40807: Show warnings once from codeop._maybe_compile (GH-20486)Miss Islington (bot)2020-06-061-0/+5
| | | | | | | | | | | | * bpo-40807: Show warnings once from codeop._maybe_compile * Move catch_warnings * news Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> (cherry picked from commit 052d3fc0907be253cfd64b2c737a0b0aca586011) Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* [3.8] bpo-40807: Backport test_codeop change [GH-19670]Terry Jan Reedy2020-06-051-4/+4
| | | A tiny sliver of a 3.9 PEG parser patch needed to backport the test added by #20486.
* [3.9] bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20613) (GH-20616)Victor Stinner2020-06-031-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | * bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579) Fix GIL usage in PyOS_Readline(): lock the GIL to set an exception. Pass tstate to my_fgets() and _PyOS_WindowsConsoleReadline(). Cleanup these functions. (cherry picked from commit c353764fd564e401cf47a5d9efab18c72c60014e) * bpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599) my_fgets() now calls _PyOS_InterruptOccurred(tstate) to check for pending signals, rather calling PyOS_InterruptOccurred(). my_fgets() is called with the GIL released, whereas PyOS_InterruptOccurred() must be called with the GIL held. test_repl: use text=True and avoid SuppressCrashReport in test_multiline_string_parsing(). Fix my_fgets() on Windows: fgets(fp) does crash if fileno(fp) is closed. (cherry picked from commit fa7ab6aa0f9a4f695e5525db5a113cd21fa93787)
* bpo-39040: Fix parsing of email mime headers with whitespace between ↵Miss Islington (bot)2020-05-291-0/+19
| | | | | | | | | | | | | | | | | | encoded-words. (gh-17620) * bpo-39040: Fix parsing of email headers with encoded-words inside a quoted string. It is fairly common to find malformed mime headers (especially content-disposition headers) where the parameter values, instead of being encoded to RFC standards, are "encoded" by doing RFC 2047 "encoded word" encoding, and then enclosing the whole thing in quotes. The processing of these malformed headers was incorrectly leaving the spaces between encoded words in the decoded text (whitespace between adjacent encoded words is supposed to be stripped on decoding). This changeset fixes the encoded word processing inside quoted strings (bare-quoted-string) to do correct RFC 2047 decoding by stripping that whitespace. (cherry picked from commit 21017ed904f734be9f195ae1274eb81426a9e776) Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
* bpo-40025: Require _generate_next_value_ to be defined before members(GH-19763)Miss Islington (bot)2020-05-271-0/+10
| | | require `_generate_next_value_` to be defined before members
* bpo-39073: validate Address parts to disallow CRLF (GH-19007)Miss Islington (bot)2020-05-271-0/+19
| | | | | | Disallow CR or LF in email.headerregistry.Address arguments to guard against header injection attacks. (cherry picked from commit 614f17211c5fc0e5b828be1d3320661d1038fe8f) Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
* Clean up compatibility code in importlib fixtures (GH-19156) (#19543)Miss Islington (bot)2020-05-271-16/+2
| | | | | | | (cherry picked from commit 574547a75c79b506261520c5773ae08a1dcea1b9) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* bpo-39244: multiprocessing return default start method first on macOS (GH-18625)Miss Islington (bot)2020-05-261-1/+3
| | | | | (cherry picked from commit db098bc1f05bd0773943e59f83489f05f28dedf8) Co-authored-by: idomic <michael.ido@gmail.com>
* [3.8] bpo-35714: Reject null characters in struct format strings (GH-16928) ↵Zackery Spytz2020-05-261-0/+7
| | | | | | | | (GH-20419) struct.error is now raised if there is a null character in a struct format string. (cherry picked from commit 3f59b55316f4c6ab451997902579aa69020b537c)
* bpo-36290: Fix keytword collision handling in AST node constructors (GH-12382)Miss Islington (bot)2020-05-241-0/+9
| | | | | (cherry picked from commit c73914a562580ae72048876cb42ed8e76e2c83f9) Co-authored-by: Rémi Lapeyre <remi.lapeyre@lenstra.fr>
* [3.8] bpo-40663: Correctly handle annotations with subscripts in ↵Batuhan Taskaya2020-05-221-0/+4
| | | | | | | ast_unparse.c (GH-20156). (GH-20191) (cherry picked from commit 2135e10dc717c00d10d899d232bebfc59bb25032) Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
* bpo-39148: enable ipv6 for datagrams in Proactor (GH-19121)Miss Islington (bot)2020-05-181-3/+12
| | | | | | | | | Ifdef is not necessary, as AF_INET6 is supported from Windows Vista, and other code in overlapped.c uses AF_INET6 and is not ifdef'd. Change the raised exception so users are not fooled to think it comes from Windows API. Automerge-Triggered-By: @njsmith (cherry picked from commit 442634c42fcaf31c636f693951a97734042c3e7b) Co-authored-by: Kjell Braden <afflux@pentabarf.de>
* bpo-40597: email: Use CTE if lines are longer than max_line_length ↵Miss Islington (bot)2020-05-181-0/+15
| | | | | | | | | | | | | | | | | | consistently (gh-20038) (gh-20084) raw_data_manager (default for EmailPolicy, EmailMessage) does correct wrapping of 'text' parts as long as the message contains characters outside of 7bit US-ASCII set: base64 or qp Content-Transfer-Encoding is applied if the lines would be too long without it. It did not, however, do this for ascii-only text, which could result in lines that were longer than policy.max_line_length or even the rfc 998 maximum. This changeset fixes the heuristic so that if lines are longer than policy.max_line_length, it will always apply a content-transfer-encoding so that the lines are wrapped correctly. (cherry picked from commit 6f2f475d5a2cd7675dce844f3af436ba919ef92b) Co-authored-by: Arkadiusz Hiler <arek.l1@gmail.com>
* bpo-40636: Clarify the zip built-in docstring. (GH-20118)Miss Islington (bot)2020-05-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Clarify the zip built-in docstring. This puts much simpler text up front along with an example. As it was, the zip built-in docstring was technically correct. But too technical for the reader who shouldn't _need_ to know about `__next__` and `StopIteration` as most people do not need to understand the internal implementation details of the iterator protocol in their daily life. This is a documentation only change, intended to be backported to 3.8; it is only tangentially related to PEP-618 which might offer new behavior options in the future. Wording based a bit more on enumerate per Brandt's suggestion. This gets rid of the legacy wording paragraph which seems too tied to implementation details of the iterator protocol which isn't relevant here. Co-authored-by: Brandt Bucher <brandtbucher@gmail.com> (cherry picked from commit 6a5d3ff67644af42b1a781be2eacb2e82913441c) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* bpo-40527: Fix command line argument parsing (GH-19955)Miss Islington (bot)2020-05-061-0/+11
| | | | | (cherry picked from commit 2668a9a5aa506a048aef7b4881c8dcf6b81c6870) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40355: Improve error messages in ast.literal_eval with malformed Dict ↵Miss Islington (bot)2020-05-051-0/+6
| | | | | | | | nodes (GH-19868) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> (cherry picked from commit c21c51235aa8061da6b0593d6f857f42fd92fd8b) Co-authored-by: Curtis Bucher <cpbucher5@gmail.com>
* bpo-40135: Fix multiprocessing test_shared_memory_across_processes() (GH-19892)Miss Islington (bot)2020-05-041-1/+3
| | | | | | | Don't define shared memory block's name in test_shared_memory_across_processes(): use SharedMemory(create=True) instead. (cherry picked from commit caa3ef284a2e5e5b9bdd6a9e619804122c842d80) Co-authored-by: Hai Shi <shihai1992@gmail.com>
* [3.8] bpo-40398: Fix typing.get_args() for special generic aliases. ↵Serhiy Storchaka2020-05-021-1/+8
| | | | | | (GH-19720) (GH-19857) (cherry picked from commit 6292be7adf247589bbf03524f8883cb4cb61f3e9)
* [3.8] bpo-39562: Prevent collision of future and compiler flags (GH-19230) ↵Pablo Galindo2020-05-011-0/+17
| | | | | | | | | | | (GH-19835) The constant values of future flags in the __future__ module is updated in order to prevent collision with compiler flags. Previously PyCF_ALLOW_TOP_LEVEL_AWAIT was clashing with CO_FUTURE_DIVISION.. (cherry picked from commit 4454057269b995341b04d13f0bf97f96080f27d0) Co-authored-by: Batuhan Taşkaya <batuhanosmantaskaya@gmail.com>
* bpo-40436: Fix code parsing gdb version (GH-19792)Miss Islington (bot)2020-04-292-2/+11
| | | | | | test_gdb and test.pythoninfo now check gdb command exit code. (cherry picked from commit ec9bea4a3766bd815148a27f61eb24e7dd459ac7) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-39983: Add test.support.print_warning() (GH-19683) (GH-19687)Victor Stinner2020-04-235-31/+51
| | | | | | | | | Log "Warning -- ..." test warnings into sys.__stderr__ rather than sys.stderr, to ensure to display them even if sys.stderr is captured. test.libregrtest.utils.print_warning() now calls test.support.print_warning(). (cherry picked from commit d663d34685e18588748569468c672763f4c73b3e)
* bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480)Miss Islington (bot)2020-04-221-0/+51
| | | | | | | | | | It is possible to use either '-isysroot /some/path' (with a space) or '-isysroot/some/path' (no space in between). Support both forms in places where special handling of -isysroot is done, rather than just the first form. Co-authored-by: Ned Deily <nad@python.org> (cherry picked from commit b310700976524b4b99ee319c947ca40468716fc9) Co-authored-by: Joshua Root <jmr@macports.org>
* bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19654)Victor Stinner2020-04-221-5/+30
| | | | | Fix the Windows implementation of os.waitpid() for exit code larger than "INT_MAX >> 8". The exit status is now interpreted as an unsigned number.
* bpo-39942:Fix failure in `TypeVar` when missing `__name__` (GH-19616)Miss Islington (bot)2020-04-201-0/+7
| | | | | | https://bugs.python.org/issue39942 (cherry picked from commit a25a04fea5446b1712cde0cff556574be139285a) Co-authored-by: HongWeipeng <hongweichen8888@sina.com>
* [3.8] bpo-40330: Fix utf-8 size check in ShareableList (GH-19606) (GH-19625)Antoine Pitrou2020-04-201-2/+14
| | | | | | | | The item size must be checked after encoding to bytes, not before. Automerge-Triggered-By: @pitrou. (cherry picked from commit eba9f6155df59c9beed97fb5764c9f01dd941af0) Co-authored-by: Antoine Pitrou <antoine@python.org>
* bpo-40260: Revert breaking changes made in modulefinder (GH-19595)Miss Islington (bot)2020-04-201-3/+14
| | | | | (cherry picked from commit 9b0b5d2baebd0b6a545317200c313a6a7408731e) Co-authored-by: Barry <barry@barrys-emacs.org>
* [3.8] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) ↵Serhiy Storchaka2020-04-181-0/+105
| | | | | | | (GH-19583) Co-authored-by: Ammar Askar <ammar@ammaraskar.com> (cherry picked from commit 12446e6a605f066d837d3a595d0a73e4f3b43b65)
* bpo-40287: Fix SpooledTemporaryFile.seek() return value (GH-19540)Miss Islington (bot)2020-04-171-2/+4
| | | | | | It has not returned the file position after the seek. (cherry picked from commit 485e715cb1ff92bc9882cd51ec32589f9cb30503) Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* bpo-39793: use the same domain on make_msgid tests (GH-18698) (GH-19554)Miss Islington (bot)2020-04-161-4/+6
| | | | | | (cherry picked from commit 5565c30f0b25996a0e73477fc0e1e1aced52b926) Co-authored-by: Batuhan Taşkaya <batuhanosmantaskaya@gmail.com>
* [3.8] bpo-39667: Sync zipp 3.0 (GH-18540) (GH-18701)Miss Islington (bot)2020-04-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | * bpo-39667: Sync zipp 3.0 (GH-18540) * bpo-39667: Improve pathlib.Path compatibility on zipfile.Path and correct performance degradation as found in zipp 3.0 * 📜🤖 Added by blurb_it. * Update docs for new zipfile.Path.open * Rely on dict, faster than OrderedDict. * Syntax edits on docs Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> (cherry picked from commit 0aeab5c4381f0cc11479362af2533b3a391312ac) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> * Clarify the change in behavior with a couple of workaround options. * Restore API compatibility while backporting performance improvements. Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* bpo-40260: Update modulefinder to use io.open_code() and respect coding ↵Miss Islington (bot)2020-04-141-5/+60
| | | | | | | comments (GH-19488) (cherry picked from commit d42e5820631cd66ee1eab8f610d4b58f3dfdd81c) Co-authored-by: Barry <barry@barrys-emacs.org>
* bpo-32033: Fix test_pwd failures on Android (GH-19502)Miss Islington (bot)2020-04-141-1/+1
| | | | | (cherry picked from commit 96515e9f6785328c52ebc5d4ce60e0087a9adc2d) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.8] Update libregrtest from master (GH-19516)Victor Stinner2020-04-147-32/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-37531: regrtest now catchs ProcessLookupError (GH-16827) Fix a warning on a race condition on TestWorkerProcess.kill(): ignore silently ProcessLookupError rather than logging an useless warning. (cherry picked from commit a661392f8fb5ac4fc095aa1845d1eb7a25c4e9be) * bpo-38502: regrtest uses process groups if available (GH-16829) test.regrtest now uses process groups in the multiprocessing mode (-jN command line option) if process groups are available: if os.setsid() and os.killpg() functions are available. (cherry picked from commit ecb035cd14c11521276343397151929a94018a22) * bpo-37957: Allow regrtest to receive a file with test (and subtests) to ignore (GH-16989) When building Python in some uncommon platforms there are some known tests that will fail. Right now, the test suite has the ability to ignore entire tests using the -x option and to receive a filter file using the --matchfile filter. The problem with the --matchfile option is that it receives a file with patterns to accept and when you want to ignore a couple of tests and subtests, is too cumbersome to lists ALL tests that are not the ones that you want to accept and he problem with -x is that is not easy to ignore just a subtests that fail and the whole test needs to be ignored. For these reasons, add a new option to allow to ignore a list of test and subtests for these situations. (cherry picked from commit e0cd8aa70a3ce19c3d3712568940aa0cbd9aa97b) * regrtest: log timeout at startup (GH-19514) Reduce also worker timeout. (cherry picked from commit 4cf65a630a8d45bad3fe5cdc4c2632ec64e7ba27) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-31758: Prevent crashes when using an uninitialized ↵Miss Islington (bot)2020-04-121-0/+15
| | | | | _elementtree.XMLParser object (GH-3997) (GH-19485) (cherry picked from commit 402e1cdb132f384e4dcde7a3d7ec7ea1fc7ab527)
* bpo-40196: Fix a bug in the symtable when reporting inspecting global ↵Miss Islington (bot)2020-04-061-1/+5
| | | | | | | variables (GH-19391) (GH-19394) (cherry picked from commit 799d7d61a91eb0ad3256ef9a45a90029cef93b7c) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-40140: test_builtin.PtyTests registers SIGHUP handler (GH-19314) (GH-19316)Victor Stinner2020-04-032-3/+20
| | | | | | | | | | test_builtin.PtyTests now registers an handler for SIGHUP signal. Closing the PTY file descriptor can emit a SIGHUP signal: just ignore it. run_child() now also closes the PTY file descriptor before waiting for the process completition, otherwise the test hangs on AIX. (cherry picked from commit 7a51a7e19f0143f75f8fc9ff68f93ed40937aec6)
* bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284) (GH-19296)Miss Islington (bot)2020-04-021-33/+57
| | | | | | | | | | | | | | | | The AbstractBasicAuthHandler class of the urllib.request module uses an inefficient regular expression which can be exploited by an attacker to cause a denial of service. Fix the regex to prevent the catastrophic backtracking. Vulnerability reported by Ben Caller and Matt Schwager. AbstractBasicAuthHandler of urllib.request now parses all WWW-Authenticate HTTP headers and accepts multiple challenges per header: use the realm of the first Basic challenge. Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> (cherry picked from commit 0b297d4ff1c0e4480ad33acae793fbaf4bf015b4)
* bpo-40121: Fix exception type in test (GH-19267)Miss Islington (bot)2020-04-011-1/+1
| | | | | (cherry picked from commit 3ef4a7e5a7c29e17d5152d1fa6ceeb1fee269699) Co-authored-by: Steve Dower <steve.dower@python.org>
* Handle when IOCTL_VM_SOCKETS_GET_LOCAL_CID does not exist in "socket" (GH-19270)Miss Islington (bot)2020-04-011-0/+2
| | | | | | | | | | Running `test_socket` or anything that depends on it (like python -m test.pythoninfo) crashes if IOCTL_VM_SOCKETS_GET_LOCAL_CID does not exist in the socket module. Automerge-Triggered-By: @pablogsal (cherry picked from commit 6eb9619c88612565b424be14196a8adae6d51978) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-40019: Skip test_gdb if Python was optimized (GH-19081)Miss Islington (bot)2020-03-311-0/+9
| | | | | | | test_gdb now skips tests if it detects that gdb failed to read debug information because the Python binary is optimized. (cherry picked from commit 7bf069b6110278102c8f4719975a5eb5a5af25f9) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-40121: Fixes audit event raised on creating a new socket (GH-19238)Miss Islington (bot)2020-03-312-0/+34
| | | | | (cherry picked from commit 63ba5cccf484b9ec23dfbf4cf7ffdc833eda98c3) Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-1812: Fix newline conversion when doctest.testfile loads from a package ↵Miss Islington (bot)2020-03-261-4/+89
| | | | | | | | whose loader has a get_data method (GH-17385) This pull request fixes the newline conversion bug originally reported in bpo-1812. When that issue was originally submitted, the open builtin did not default to universal newline mode; now it does, which makes the issue fix simpler, since the only code path that needs to be changed is the one in doctest._load_testfile where the file is loaded from a package whose loader has a get_data method. (cherry picked from commit e0b8101492f6c61dee831425b4d3dae39a953599) Co-authored-by: Peter Donis <peterdonis@alum.mit.edu>
* bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch ↵Miss Islington (bot)2020-03-222-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-9516) (GH-19110) * bpo-22490: Remove "__PYVENV_LAUNCHER__" from the shell environment on macOS This changeset removes the environment varialbe "__PYVENV_LAUNCHER__" during interpreter launch as it is only needed to communicate between the stub executable in framework installs and the actual interpreter. Leaving the environment variable present may lead to misbehaviour when launching other scripts. * Actually commit the changes for issue 22490... * Correct typo Co-Authored-By: Nicola Soranzo <nicola.soranzo@gmail.com> * Run make patchcheck Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com> (cherry picked from commit 044cf94f610e831464a69a8e713dad89878824ce) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com> Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
* [3.8] bpo-27807: Skip test_site.test_startup_imports() if pth file ↵Victor Stinner2020-03-201-0/+19
| | | | | | | | (GH-19060) (GH-19090) test_site.test_startup_imports() is now skipped if a path of sys.path contains a .pth file. Sort test_site imports.
* bpo-39562: Allow executing asynchronous comprehensions in the asyncio REPL ↵Miss Islington (bot)2020-03-191-1/+8
| | | | | | | | (GH-18968) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> (cherry picked from commit 9052f7a41b90f2d34011c8da68f9a4facebc8a97) Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>