summaryrefslogtreecommitdiff
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* Revert "bpo-43510: PEP 597: Accept `encoding="locale"` in binary mode ↵revert-25103-binary-localeInada Naoki2021-03-311-11/+0
| | | | | | (GH-25103)" This reverts commit ff3c9739bd69aa8b58007e63c9e40e6708b4761e.
* bpo-43510: PEP 597: Accept `encoding="locale"` in binary mode (GH-25103)Inada Naoki2021-03-311-0/+11
| | | | It make `encoding="locale"` usable everywhere `encoding=None` is allowed.
* bpo-40066: Enum: modify `repr()` and `str()` (GH-22392)Ethan Furman2021-03-306-129/+160
| | | | | | | | | * Enum: streamline repr() and str(); improve docs - repr() is now ``enum_class.member_name`` - stdlib global enums are ``module_name.member_name`` - str() is now ``member_name`` - add HOW-TO section for ``Enum`` - change main documentation to be an API reference
* bpo-43399: Fix ElementTree.extend not working on iterators (GH-24751)Alex Prengère2021-03-311-0/+3
|
* bpo-42134: Raise ImportWarning when calling find_module() in the import ↵Brett Cannon2021-03-302-4/+14
| | | | system (GH-25044)
* bpo-43125: Fix: return expected type (str), not original value (bytes) in ↵Grégory Starck2021-03-301-2/+1
| | | | email/base64mime.py::body_encode (GH-24476)
* bpo-43660: Fix crash when displaying exceptions with custom values for ↵Pablo Galindo2021-03-291-0/+15
| | | | sys.stderr (GH-25075)
* bpo-43659: Fix test_curses on AIX (GH-25074)Michael Felt2021-03-291-0/+1
| | | | | | curses.update_lines_cols() is only defined when the curses library provides either resizeterm() or resize_term() functions which are optional and are not provided on AIX.
* bpo-43433: Preserve query and fragment in the URL of the server in ↵Serhiy Storchaka2021-03-291-1/+39
| | | | ServerProxy. (GH-25057)
* bpo-42988: Remove the pydoc getfile feature (GH-25015)Victor Stinner2021-03-291-6/+0
| | | | | | | CVE-2021-3426: Remove the "getfile" feature of the pydoc module which could be abused to read arbitrary files on the disk (directory traversal vulnerability). Moreover, even source code of Python modules can contain sensitive data like passwords. Vulnerability reported by David Schwörer.
* bpo-43510: Implement PEP 597 opt-in EncodingWarning. (GH-19481)Inada Naoki2021-03-295-2/+29
| | | | | | | | | | | See [PEP 597](https://www.python.org/dev/peps/pep-0597/). * Add `-X warn_default_encoding` and `PYTHONWARNDEFAULTENCODING`. * Add EncodingWarning * Add io.text_encoding() * open(), TextIOWrapper() emits EncodingWarning when encoding is omitted and warn_default_encoding is enabled. * _pyio.TextIOWrapper() uses UTF-8 as fallback default encoding used when failed to import locale module. (used during building Python) * bz2, configparser, gzip, lzma, pathlib, tempfile modules use io.text_encoding(). * What's new entry
* bpo-25643: Refactor the C tokenizer into smaller, logical units (GH-25050)Pablo Galindo2021-03-282-2/+19
|
* bpo-43562: fix test_ssl to skip on unreachable network (GH-24937)Carl Meyer2021-03-271-0/+2
| | | This test checks result code of the connection directly, so it never raises an exception that can be suppressed by `support.transient_internet`. Directly support skipping the test in case of unreachable network.
* bpo-40645: use C implementation of HMAC (GH-24920)Christian Heimes2021-03-271-45/+69
| | | | | | - [x] fix tests - [ ] add test scenarios for old/new code. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-42136: Deprecate module_repr() as found in importlib (GH-25022)Brett Cannon2021-03-263-6/+29
|
* bpo-41064: Improve syntax error for invalid usage of '**' in f-strings ↵Pablo Galindo2021-03-241-0/+9
| | | | (GH-25006)
* bpo-42137: have ModuleType.__repr__ prefer __spec__ over module_repr() ↵Brett Cannon2021-03-242-9/+2
| | | | | (GH-24953) This is to work towards the removal of the use of module_repr() in Python 3.12 (documented as deprecated since 3.4).
* bpo-42914: add a pprint underscore_numbers option (GH-24864)sblondon2021-03-241-0/+13
| | | | | pprint() gains a new boolean underscore_numbers kwarg to emit integers with thousands separated by an underscore character for improved readability (for example 1_000_000 instead of 1000000).
* bpo-31861: Add aiter and anext to builtins (#23847)Joshua Bronson2021-03-232-0/+85
| | | | | | Co-authored-by: jab <jab@users.noreply.github.com> Co-authored-by: Daniel Pope <mauve@mauveweb.co.uk> Co-authored-by: Justin Wang <justin39@gmail.com>
* bpo-41718: libregrtest avoids importing datetime (GH-24985)Victor Stinner2021-03-232-5/+6
| | | | * libregrtest reimplements datetime.timedelta.__str__() * support.testresult only imports datetime if USE_XML is true.
* bpo-41718: Disable support.testresult XML output by default (GH-24982)Victor Stinner2021-03-232-7/+22
| | | | | | | RegressionTestResult.USE_XML must now be set to True to get the JUnit XML output. Reduce the number of imports when --junit-xml=FILE option is not used: 153 => 144 (-9).
* bpo-41718: libregrtest runtest avoids import_helper (GH-24983)Victor Stinner2021-03-231-2/+4
| | | | Inline import_helper.unload() in libregrtest.runtest to avoid one import.
* bpo-41718: Reduce libregrtest runtest imports (GH-24980)Victor Stinner2021-03-233-97/+107
| | | | | | Move clear_caches() from libregrtest.refleak to libregrtest.utils to avoid importing libregrtest.refleak when it's not needed. clear_caches() now only calls re.purge() if 're' is in sys.modules.
* bpo-41718: regrtest saved_test_environment avoids imports (GH-24934)Victor Stinner2021-03-222-42/+69
| | | | | | | | | | | | | | | | | | | | | | | | | Reduce the number of modules imported by libregrtest. saved_test_environment no longer imports modules at startup, but try to get them from sys.modules. If an module is missing, skip the test. It also sets directly support.environment_altered. runtest() now now two saved_test_environment instances: one before importing the test module, one after importing it. Remove imports from test.libregrtest.save_env: * asyncio * logging * multiprocessing * shutil * sysconfig * urllib.request * warnings When a test method imports a module (ex: warnings) and the test has a side effect (ex: add a warnings filter), the side effect is not detected, because the module was not imported when Python enters the saved_test_environment context manager.
* bpo-43555: Report the column offset for invalid line continuation character ↵Pablo Galindo2021-03-221-0/+5
| | | | (GH-24939)
* bpo-43591: Fix error location in interactive mode for errors at the end of ↵Pablo Galindo2021-03-221-2/+8
| | | | | the line (GH-24973) Co-authored-by: Erlend Egeberg Aasland
* bpo-43420: Simple optimizations for Fraction's arithmetics (GH-24779)Sergey B Kirpichev2021-03-211-0/+2
| | | | | | | bpo-43420: Implement standard transformations in + - * / that can often reduce the size of intermediate integers needed. For rationals with large components, this can yield dramatic speed improvements, but for small rationals can run 10-20% slower, due to increased fixed overheads in the longer-winded code. If those slowdowns turn out to be a problem, see the PR discussion for low-level implementation tricks that could cut other fixed overheads. Co-authored-by: Tim Peters <tim.peters@gmail.com> Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
* bpo-43422: Revert _decimal C API addition (GH-24960)Antoine Pitrou2021-03-211-176/+0
| | | | | | | | | Stefan Krah requested the reversal of these (unreleased) changes, quoting him: > The capsule API does not meet my testing standards, since I've focused on the upstream mpdecimal in the last couple of months. > Additionally, I'd like to refine the API, perhaps together with the Arrow community. Automerge-Triggered-By: GH:pitrou
* bpo-43577: Fix deadlock with SSLContext._msg_callback and sni_callback ↵Christian Heimes2021-03-211-0/+22
| | | | | | | | | | | | (GH-24957) OpenSSL copies the internal message callback from SSL_CTX->msg_callback to SSL->msg_callback. SSL_set_SSL_CTX() does not update SSL->msg_callback to use the callback value of the new context. PySSL_set_context() now resets the callback and _PySSL_msg_callback() resets thread state in error path. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-43517: Fix false positive in detection of circular imports (#24895)Antoine Pitrou2021-03-203-1/+78
|
* bpo-41561: Add workaround for Ubuntu's custom security level (GH-24915)Christian Heimes2021-03-181-0/+29
| | | | | | | | | | Ubuntu 20.04 comes with a patched OpenSSL 1.1.1. Default security level 2 blocks TLS 1.0 and 1.1 connections. Regular OpenSSL 1.1.1 builds allow TLS 1.0 and 1.1 on security level 2. See: See: https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1899878 See: https://bugs.launchpad.net/ubuntu/+source/openssl/+bug/1917625 Signed-off-by: Christian Heimes <christian@python.org>
* bpo-43521: Allow ast.unparse with empty sets and NaN (GH-24897)Kodi Arfer2021-03-181-3/+12
| | | Automerge-Triggered-By: GH:pablogsal
* bpo-39342: Expose X509_V_FLAG_ALLOW_PROXY_CERTS in ssl module (GH-18011)Chris Burr2021-03-181-0/+2
| | | Exposes the `X509_V_FLAG_ALLOW_PROXY_CERTS` constant as `ssl.VERIFY_ALLOW_PROXY_CERTS` to allow for proxy certificate validation as described in: https://www.openssl.org/docs/man1.1.1/man7/proxy-certificates.html
* bpo-42128: Add 'missing :' syntax error message to match statements (GH-24733)Pablo Galindo2021-03-181-0/+36
|
* bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843)Victor Stinner2021-03-171-26/+60
| | | | | | | | | | Python no longer fails at startup with a fatal error if a command line argument contains an invalid Unicode character. The Py_DecodeLocale() function now escapes byte sequences which would be decoded as Unicode characters outside the [U+0000; U+10ffff] range. Use MAX_UNICODE constant in unicodeobject.c.
* bpo-43497: Emit SyntaxWarnings for assertions with tuple constants. (GH-24867)tsukasa-au2021-03-161-2/+28
| | | | | | | | | | | | | | | | | | | * bpo-43497: Emit SyntaxWarnings for assertions with tuple constants. Add a test that shows that a tuple constant (a tuple, where all of its members are also compile-time constants) produces a SyntaxWarning. Then fix this failure. * Make SyntaxWarnings also work when "optimized". * Split tests for SyntaxWarning to SyntaxError conversion SyntaxWarnings emitted by the compiler when configured to be errors are actually raised as SyntaxError exceptions. Move these tests into their own method and add a test to ensure they are raised. Previously we only tested that they were not raised for a "valid" assertion statement.
* bpo-43285 Make ftplib not trust the PASV response. (GH-24838)Gregory P. Smith2021-03-151-1/+26
| | | | | | | | | | | | | | | bpo-43285: Make ftplib not trust the PASV response. The IPv4 address value returned from the server in response to the PASV command should not be trusted. This prevents a malicious FTP server from using the response to probe IPv4 address and port combinations on the client network. Instead of using the returned address, we use the IP address we're already connected to. This is the strategy other ftp clients adopted, and matches the only strategy available for the modern IPv6 EPSV command where the server response must return a port number and nothing else. For the rare user who _wants_ this ugly behavior, set a `trust_server_pasv_ipv4_address` attribute on your `ftplib.FTP` instance to True.
* Mark POP_TOP at end of expression statement as artificial, to conform to PEP ↵Mark Shannon2021-03-151-0/+8
| | | | 626. (GH-24860)
* bpo-29982: Add "ignore_cleanup_errors" param to ↵CAM Gerlach2021-03-141-2/+88
| | | | tempfile.TemporaryDirectory() (GH-24793)
* bpo-39316: Make sure that attribute accesses and stores, including method ↵Mark Shannon2021-03-141-0/+45
| | | | calls, conform to PEP 626. (GH-24859)
* bpo-43410: Fix crash in the parser when producing syntax errors when reading ↵Pablo Galindo2021-03-141-1/+8
| | | | from stdin (GH-24763)
* bpo-43245: Add keyword argument support to ChainMap.new_child() (GH-24788)Kamil Turek2021-03-131-0/+4
|
* bpo-43428: Sync with importlib_metadata 3.7. (GH-24782)Jason R. Coombs2021-03-134-13/+88
| | | | | | | * bpo-43428: Sync with importlib_metadata 3.7.2 (67234b6) * Add blurb * Reformat blurb to create separate paragraphs for each change included.
* bpo-27820: Fix AUTH LOGIN logic in smtplib.SMTP (GH-24118)Pandu E POLUAN2021-03-121-1/+44
| | | | | | * Fix auth_login logic (bpo-27820) * Also fix a longstanding bug in the SimSMTPChannel.found_terminator() method that causes inability to test SMTP AUTH with initial_response_ok=False.
* bpo-43356: Allow passing a signal number to interrupt_main() (GH-24755)Antoine Pitrou2021-03-111-10/+33
| | | | Also introduce a new C API ``PyErr_SetInterruptEx(int signum)``.
* bpo-43406: Fix test_signal.test_stress_modifying_handlers() (GH-24815)Victor Stinner2021-03-101-3/+13
| | | | | | | Fix a race condition of test_stress_modifying_handlers() of test_signal: only raise signals while we are in the catch_unraisable_exception() context manager. Moreover, don't check if we received at least one signal if at least one signal got ignored.
* bpo-43439: Add audit hooks for gc functions (GH-24794)Pablo Galindo2021-03-102-0/+31
|
* bpo-14678: Update zipimport to support importlib.invalidate_caches() (GH-24159)Desmond Cheong2021-03-081-0/+41
| | | Added an invalidate_caches() method to the zipimport.zipimporter class based on the implementation of importlib.FileFinder.invalidate_caches(). This was done by adding a get_files() method and an _archive_mtime attribute to zipimport.zipimporter to check for updates or cache invalidation whenever the cache of files and toc entry information in the zipimporter is accessed.
* bpo-43332: Buffer proxy connection setup packets before sending. (GH-24780)Gregory P. Smith2021-03-071-0/+18
| | | | | | We now buffer the CONNECT request + tunnel HTTP headers into a single send call. This prevents the OS from generating multiple network packets for connection setup when not necessary, improving efficiency.
* bpo-43405: Fix DeprecationWarnings in test_unicode (GH-24754)Zackery Spytz2021-03-071-20/+24
| | | | DeprecationWarnings were being raised in the test_encode_decimal() and test_transform_decimal() methods after 91a639a0949.