summaryrefslogtreecommitdiff
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-39481: Make os.DirEntry generic (GH-19415)Batuhan Taşkaya2020-04-071-1/+2
|
* bpo-40089: Add _at_fork_reinit() method to locks (GH-19195)Victor Stinner2020-04-071-2/+28
| | | | | | | | | | | | | | | Add a private _at_fork_reinit() method to _thread.Lock, _thread.RLock, threading.RLock and threading.Condition classes: reinitialize the lock after fork in the child process; reset the lock to the unlocked state. Rename also the private _reset_internal_locks() method of threading.Event to _at_fork_reinit(). * Add _PyThread_at_fork_reinit() private function. It is excluded from the limited C API. * threading.Thread._reset_internal_locks() now calls _at_fork_reinit() on self._tstate_lock rather than creating a new Python lock object.
* bpo-39481: Implementation for PEP 585 (#18239)Guido van Rossum2020-04-078-15/+235
| | | | | | | | | | | | This implements things like `list[int]`, which returns an object of type `types.GenericAlias`. This object mostly acts as a proxy for `list`, but has attributes `__origin__` and `__args__` that allow recovering the parts (with values `list` and `(int,)`. There is also an approximate notion of type variables; e.g. `list[T]` has a `__parameters__` attribute equal to `(T,)`. Type variables are objects of type `typing.TypeVar`.
* bpo-40196: Fix a bug in the symtable when reporting inspecting global ↵Pablo Galindo2020-04-061-1/+5
| | | | variables (GH-19391)
* bpo-40182: Remove the _field_types attribute of the NamedTuple class (GH-19368)Serhiy Storchaka2020-04-051-4/+2
|
* bpo-36517: Raise error on multiple inheritance with NamedTuple (GH-19363)Serhiy Storchaka2020-04-041-0/+7
|
* bpo-40141: Include the value in the column position for keyword AST nodes ↵Pablo Galindo2020-04-031-1/+1
| | | | (GH-19348)
* bpo-40147: Move the check for duplicate keywords to the compiler (GH-19289)Pablo Galindo2020-04-032-2/+2
|
* bpo-40140: test_builtin.PtyTests registers SIGHUP handler (GH-19314)Victor Stinner2020-04-032-8/+21
| | | | | | | | 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.
* bpo-40115: Fix refleak in test_asyncio.test_run_in_executor_cancel() (GH-19282)Kyle Stanley2020-04-021-0/+2
| | | Call explicitly self.loop.shutdown_default_executor().
* bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284)Victor Stinner2020-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>
* bpo-40141: Add line and column information to ast.keyword nodes (GH-19283)Pablo Galindo2020-04-021-1/+1
|
* bpo-40094: Add os.waitstatus_to_exitcode() (GH-19201)Victor Stinner2020-04-016-16/+37
| | | | | | | | | | | | | | Add os.waitstatus_to_exitcode() function to convert a wait status to an exitcode. Suggest waitstatus_to_exitcode() usage in the documentation when appropriate. Use waitstatus_to_exitcode() in: * multiprocessing, os, subprocess and _bootsubprocess modules; * test.support.wait_process(); * setup.py: run_command(); * and many tests.
* bpo-39682: make `pathlib.Path` immutable by removing (undocumented) support ↵Barney Gale2020-04-011-7/+9
| | | | | | for "closing" a path by using it as a context manager (GH-18846) Support for using a path as a context manager remains, and is now a no-op.
* bpo-33262: Deprecate passing None for `s` to shlex.split() (GH-6514)Zackery Spytz2020-04-011-1/+6
| | | | | | | | | * bpo-33262: Deprecate passing None for `s` to shlex.split() This reads the string to split from standard input. * Update What's New. * Fix shlex.rst
* bpo-40121: Fix exception type in test (GH-19267)Steve Dower2020-04-011-1/+1
|
* Handle when IOCTL_VM_SOCKETS_GET_LOCAL_CID does not exist in "socket" (GH-19270)Pablo Galindo2020-03-311-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
* bpo-40094: Add missing import to wait_process() (GH-19268)Victor Stinner2020-04-011-0/+2
|
* bpo-31160: Fix race condition in test_os.PtyTests (GH-19263)Victor Stinner2020-04-011-2/+9
| | | | bpo-31160, bpo-40094: Wait until the process completes before closing the PTY to prevent sending SIGHUP to the child process.
* bpo-40094: Enhance threading tests (GH-19260)Victor Stinner2020-03-312-31/+39
| | | | | | | * Rewrite test_thread.test_forkinthread() to use support.wait_process() and wait for the child process in the main thread, not in the spawned thread. * test_threading now uses support.wait_process() and checks the child process exit code to detect crashes.
* bpo-40094: Enhance fork and wait tests (GH-19259)Victor Stinner2020-03-314-24/+15
| | | | | | * test_fork1: remove duplicated wait_impl() method: reuse fork_wait.py implementation instead. * Use exit code different than 0 to ensure that we executed the expected code path.
* bpo-40094: Add test.support.wait_process() (GH-19254)Victor Stinner2020-03-3117-103/+109
| | | | | | | | | Moreover, the following tests now check the child process exit code: * test_os.PtyTests * test_mailbox.test_lock_conflict() * test_tempfile.test_process_awareness() * test_uuid.testIssue8621() * multiprocessing resource tracker tests
* bpo-40003: test.bisect_cmd copies Python options (GH-19246)Victor Stinner2020-03-311-2/+14
| | | | | test.bisect_cmd now copies Python command line options like -O or -W. Moreover, emit a warning if test.bisect_cmd is used with -w/--verbose2 option.
* bpo-40121: Fixes audit event raised on creating a new socket (GH-19238)Steve Dower2020-03-312-0/+34
|
* bpo-40108: Improve the error message in runpy when importing a module that ↵Pablo Galindo2020-03-311-0/+10
| | | | includes the extension (GH-19239)
* Fix bug in test_collections.py (#19221)Curtis Bucher2020-03-301-1/+2
| | | Test in TestChainMap() line 257 did not properly check union behavior.
* bpo-40077: Convert _abc module to use PyType_FromSpec() (GH-19202)Dong-hee Na2020-03-301-1/+1
| | | | | | | Replace statically allocated types with heap allocated types: use PyType_FromSpec(). Add a module state to store the _abc_data_type. Add traverse, clear and free functions to the module.
* bpo-39073: validate Address parts to disallow CRLF (#19007)Ashwin Ramaswami2020-03-291-0/+19
| | | Disallow CR or LF in email.headerregistry.Address arguments to guard against header injection attacks.
* bpo-40086: Update/fix test_etree test case in test_typing (GH-19189)Furkan Önder2020-03-281-4/+2
|
* bpo-39812: Remove daemon threads in concurrent.futures (GH-19149)Kyle Stanley2020-03-271-0/+50
| | | | | | Remove daemon threads from :mod:`concurrent.futures` by adding an internal `threading._register_atexit()`, which calls registered functions prior to joining all non-daemon threads. This allows for compatibility with subinterpreters, which don't support daemon threads.
* bpo-1812: Fix newline conversion when doctest.testfile loads from a package ↵Peter Donis2020-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.
* bpo-40067: Improve error messages for multiple star expressions in ↵Furkan Önder2020-03-261-2/+7
| | | | | | assignments (GH-19168) Co-Authored-By: Batuhan Taşkaya <isidentical@gmail.com> Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
* bpo-36144: Add union operators to WeakValueDictionary584 (#19127)Curtis Bucher2020-03-241-0/+37
|
* bpo-40029 mark test_importlib.test_zip as requiring zlib (#19105)Roman Yurchak2020-03-241-0/+4
| | | | | * bpo-40029 mark test_importlib.test_zip as requiring zlib * Decorate TestZip / TestEgg classes as requiring zlib
* bpo-20526: Fix PyThreadState_Clear(): don't decref frame (GH-19120)Victor Stinner2020-03-241-28/+0
| | | | | | | | PyThreadState.frame is a borrowed reference, not a strong reference: PyThreadState_Clear() must not call Py_CLEAR(tstate->frame). Remove test_threading.test_warnings_at_exit(): we cannot warranty that the Python thread state of daemon threads is cleared in a reliable way during Python shutdown.
* bpo-36144: Add union operators to WeakKeyDictionary (#19106)Curtis Bucher2020-03-231-0/+37
|
* bpo-36144: Add PEP 584 operators to collections.ChainMap (#18832)Curtis Bucher2020-03-231-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update ChainMap to include | and |= Created __ior__, __or__ and __ror__ methods in ChainMap class. * Update ACKS * Update docs * Update test_collections.py to include test_issue584(). Added testing for | and |= operators for ChainMap objects. * Update test_union_operators Renamed test_union operators, fixed errors and style problems raised by brandtbucher. * Update test_union_operators in TestChainMap Added testing for union operator between ChainMap and iterable of key-value pairs. * Update test_union operators in test_collections.py Gave more descriptive variable names and eliminated unnecessary tmp variable. * Update test_union_operators in test_collections.py Added cm3 * Check .maps rather than Chainmap equality. * Add news entry * Update Lib/test/test_collections.py Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com> * Removed whitespace * Added Guido's changes * Fixed Docs * Removed whitespace Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* bpo-39999: Improve compatibility of the ast module. (GH-19056)Serhiy Storchaka2020-03-221-2/+2
| | | | | | | * Re-add removed classes Suite, slice, Param, AugLoad and AugStore. * Add docstrings for dummy classes. * Add docstrings for attribute aliases. * Set __module__ to "ast" instead of "_ast".
* bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516)Ronald Oussoren2020-03-222-1/+12
| | | | | | | | | | | | | | | | | | | | | * 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>
* bpo-36543: Remove the xml.etree.cElementTree module. (GH-19108)Serhiy Storchaka2020-03-221-15/+0
|
* bpo-40019: Skip test_gdb if Python was optimized (GH-19081)Victor Stinner2020-03-201-0/+9
| | | | test_gdb now skips tests if it detects that gdb failed to read debug information because the Python binary is optimized.
* bpo-39562: Allow executing asynchronous comprehensions in the asyncio REPL ↵Batuhan Taşkaya2020-03-191-1/+8
| | | | | (GH-18968) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-40000: Improve error messages when validating invalid ast.Constant nodes ↵Batuhan Taşkaya2020-03-191-0/+9
| | | | | (GH-19055) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-39220: Do not optimise annotation if 'from __future__ import ↵Pablo Galindo2020-03-181-1/+9
| | | | | | annotations' is used (GH-17866) Do not apply AST-based optimizations if 'from __future__ import annotations' is used in order to prevent information lost in the final version of the annotations.
* bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060)Victor Stinner2020-03-181-4/+23
| | | | | | test_site.test_startup_imports() is now skipped if a path of sys.path contains a .pth file. Sort test_site imports.
* bpo-39957: Change Signature.parameters to OrderedDict (GH-18988)Jens Reidel2020-03-181-1/+6
|
* bpo-39984: _PyThreadState_DeleteCurrent() takes tstate (GH-19051)Victor Stinner2020-03-181-1/+2
| | | | | | | | | | * _PyThreadState_DeleteCurrent() now takes tstate rather than runtime. * Add ensure_tstate_not_null() helper to pystate.c. * Add _PyEval_ReleaseLock() function. * _PyThreadState_DeleteCurrent() now calls _PyEval_ReleaseLock(tstate) and frees PyThreadState memory after this call, not before. * PyGILState_Release(): rename "tcur" variable to "tstate".
* bpo-39991: Enhance uuid parser for MAC address (GH-19045)Victor Stinner2020-03-171-0/+52
| | | | Reject valid IPv6 addresses which doesn't contain "::" but have a length of 17 characters.
* bpo-39824: module_traverse() don't call m_traverse if md_state=NULL (GH-18738)Victor Stinner2020-03-171-23/+0
| | | | | | | | | | | | | Extension modules: m_traverse, m_clear and m_free functions of PyModuleDef are no longer called if the module state was requested but is not allocated yet. This is the case immediately after the module is created and before the module is executed (Py_mod_exec function). More precisely, these functions are not called if m_size is greater than 0 and the module state (as returned by PyModule_GetState()) is NULL. Extension modules without module state (m_size <= 0) are not affected. Co-Authored-By: Petr Viktorin <encukou@gmail.com>
* bpo-26067: Do not fail test_shutil / chown when gid/uid cannot be resolved ↵Matthias Braun2020-03-171-6/+11
| | | | | | | | | | | | | | | | | | | (#19032) * bpo-26067: Do not fail test_shutil.chown when gid/uid cannot be resolved There is no guarantee that the users primary uid or gid can be resolved in the unix group/account databases. Skip the last part of the chown test if we cannot resolve the gid or uid to a name. * 📜🤖 Added by blurb_it. * Address review feedback * address review feedback correctly * fix typo Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>