summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* [WIP/RFC] bpo-15872: tests: remove oddity from test_rmtree_errors (GH-22967)Daniel Hahler2020-12-211-6/+3
| | | | | | | | | This was added for (some) Windows buildbots back in 2012, and should either not be necessary anymore, or it should probably get investigated why "\*.*" gets added to filenames in the first place. Ref: Automerge-Triggered-By: GH:hynek
* bpo-31904: Fix site and sysconfig modules for VxWorks RTOS (GH-21821)pxinwr2020-12-206-72/+112
|
* bpo-42630: Improve error reporting in Tkinter for absent default root (GH-23781)Serhiy Storchaka2020-12-1917-79/+307
| | | | | | | | | | | * 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.
* bpo-42470: Do not warn on sequences which are also sets in random.sample() ↵masklinn2020-12-192-7/+24
| | | | (GH-23665)
* bpo-34805: Guarantee that __subclasses__() is in definition order. (GH-23844)Raymond Hettinger2020-12-191-0/+10
|
* bpo-24792: Fix zipimporter masking the cause of import errors (GH-22204)Irit Katriel2020-12-192-22/+24
| | | | | zipimport's _unmarshal_code swallows import errors and then _get_module_code doesn't know the cause of the error, and returns the generic, and sometimes incorrect, 'could not find...'. Automerge-Triggered-By: GH:brettcannon
* bpo-36769: Document that fnmatch.filter supports any kind of iterable (#13039)Andre Delfino2020-12-181-1/+1
|
* bpo-41891: ensure asyncio.wait_for waits for task completion (#22461)Richard Kojedzinszky2020-12-182-1/+65
|
* bpo-42199: Fix bytecode_helper assertNotInBytecode (#23031)Max Bernstein2020-12-182-1/+21
| | | | | | | | | | * bpo-42199: Fix bytecode_helper assertNotInBytecode Add tests. * 📜🤖 Added by blurb_it. Co-authored-by: Dino Viehland <dinoviehland@fb.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-31904: posixpath.expanduser() handles None user home on VxWorks (GH-23530)pxinwr2020-12-171-0/+3
|
* bpo-42246: Make sure that `f_lasti`, and thus `f_lineno`, is set correctly ↵Mark Shannon2020-12-174-9/+93
| | | | | | | | | after raising or reraising an exception (GH-23803) * Ensure that f_lasti is set correctly after an exception is raised to conform to PEP 626. * Update importlib * Add NEWS.
* bpo-31904: Skip some asyncio tests on VxWorks (#23815)pxinwr2020-12-172-1/+10
|
* Correct referenced RFC number in cgi module (GH-22827)Mike Lei2020-12-171-1/+1
| | | The quoted sentence can be found from the last paragraph of RFC 2046, Section 5.1, while the content of RFC 2026 is unrelated to this module.
* bpo-37961: Fix regression in tracemalloc.Traceback.__repr__ (GH-23805)Daniel Hahler2020-12-162-1/+21
| | | Regression in 8d59eb1b66c51b2b918da9881c57d07d08df43b7.
* bpo-38323: Add guard clauses in MultiLoopChildWatcher. (#22756)Chris Jerdonek2020-12-161-14/+18
| | | This is a trivial refactor in preparation for a fix for bpo-38323.
* bpo-42645: Make sure that return/break/continue are only traced once when ↵Mark Shannon2020-12-162-12/+117
| | | | | | | | | exiting via a finally block. (GH-23780) * Make sure that return/break/continue are only traced once when exiting via a finally block. * Add test for return in try-finally. * Update importlib
* bpo-42615: Delete redundant jump instructions that only bypass empty blocks ↵Om G2020-12-161-0/+28
| | | | | | | | | | | | | | | | | | | | | | | (GH-23733) * Delete jump instructions that bypass empty blocks * Add news entry * Explicitly check for unconditional jump opcodes Using the is_jump function results in the inclusion of instructions like returns for which this optimization is not really valid. So, instead explicitly check that the instruction is an unconditional jump. * Handle conditional jumps, delete jumps gracefully * Ensure b_nofallthrough and b_reachable are valid * Add test for redundant jumps * Regenerate importlib.h and edit Misc/ACKS * Fix bad whitespace
* bpo-40364: asyncio uses os.waitstatus_to_exitcode() (GH-23798)Victor Stinner2020-12-162-215/+80
| | | | | test_unix_events.py no longer checks if waitstatus_to_exitcode() mock has been called or not to make the test more functional, rather than checking the exact implementation.
* bpo-19733: Re-enable tests for -image option in Tkinter (GH-23785)Serhiy Storchaka2020-12-162-6/+0
|
* bpo-41804: Enhance test_epoll.test_control_and_wait() (GH-23795)Victor Stinner2020-12-161-13/+11
| | | Use shorter timeout and replace send() with sendall().
* bpo-42644: Validate values in logging.disable() (#23786)Matthias Bussonnier2020-12-162-0/+17
| | | | | | | | | | | | | | | | | | | * 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>
* bpo-42090: zipfile.Path.joinpath now accepts multiple arguments (GH-22976)Jason R. Coombs2020-12-162-2/+8
| | | Automerge-Triggered-By: GH:jaraco
* bpo-31904: Skip os.path.expanduser() tests on VxWorks (GH-23776)pxinwr2020-12-152-0/+5
|
* bpo-31904: Skip some tests of changing owner in _test_all_chown_common() on ↵pxinwr2020-12-151-2/+11
| | | | VxWorks (GH-23716)
* bpo-31904: Disable os.popen and popen test cases on VxWorks (GH-21687)pxinwr2020-12-155-45/+56
|
* bpo-40219: Lowered ttk LabeledScale dummy (GH-21467)E-Paine2020-12-151-1/+4
|
* bpo-42641: Enhance test_select.test_select() (GH-23782)Victor Stinner2020-12-151-9/+21
| | | | | | | | | Enhance test_select.test_select(): it now takes 500 ms rather than 10 seconds. * Use Python rather than a shell as the child process to make the test more portable. * Use a sleep of 50 ms per line rather than 1 second. * Use subprocess.Popen rather than os.popen().
* bpo-42639: atexit._run_exitfuncs() uses sys.unraisablehook (GH-23779)Victor Stinner2020-12-153-149/+126
| | | | | | | | | | atexit._run_exitfuncs() now logs callback exceptions using sys.unraisablehook, rather than logging them directly into sys.stderr and raising the last exception. Run GeneralTest of test_atexit in a subprocess since it calls atexit._clear() which clears all atexit callbacks. _PyAtExit_Fini() sets state->callbacks to NULL.
* bpo-42639: Add script_helper.run_test_script() (GH-23777)Victor Stinner2020-12-153-16/+34
| | | | | | * Add run_test_script() function to test.support.script_helper. * Rename Lib/test/eintrdata/eintr_tester.py to Lib/test/_test_eintr.py. * test_eintr.py uses run_test_script().
* bpo-42639: Move atexit state to PyInterpreterState (GH-23763)Victor Stinner2020-12-151-0/+18
| | | | | | | | | * Add _PyAtExit_Call() function and remove pyexitfunc and pyexitmodule members of PyInterpreterState. The function logs atexit callback errors using _PyErr_WriteUnraisableMsg(). * Add _PyAtExit_Init() and _PyAtExit_Fini() functions. * Remove traverse, clear and free functions of the atexit module. Co-authored-by: Dong-hee Na <donghee.na@python.org>
* bpo-42246: Remove DO_NOT_EMIT_BYTECODE macros, so that while loops and if ↵Mark Shannon2020-12-154-88/+84
| | | | statements conform to PEP 626. (GH-23743)
* bpo-33610: Edit idlelib.codecontext (GH-23773)Terry Jan Reedy2020-12-151-5/+8
| | | Add sentence to module docstring and import tkinter items.
* bpo-42639: atexit now logs callbacks exceptions (GH-23771)Victor Stinner2020-12-141-1/+0
| | | | | | | | | | | At Python exit, if a callback registered with atexit.register() fails, its exception is now logged. Previously, only some exceptions were logged, and the last exception was always silently ignored. Add _PyAtExit_Call() function and remove PyInterpreterState.atexit_func member. call_py_exitfuncs() now calls directly _PyAtExit_Call(). The atexit module must now always be built as a built-in module.
* bpo-42639: Cleanup atexitmodule.c (GH-23770)Victor Stinner2020-12-141-11/+12
| | | | | | | | | * Rename "atexitmodule_state" to "struct atexit_state". * Rename "modstate" to "state". * Rename "self" parameter to "module". * test_atexit uses textwrap.dedent(). * Remove _Py_PyAtExit() function: inline it into atexit_exec(). * PyInterpreterState: rename pyexitfunc to atexit_func, rename pyexitmodule to atexit_module.
* bpo-41877: Check for misspelled speccing arguments (GH-23737)vabr-g2020-12-142-8/+83
| | | | | | | | | | | | patch, patch.object and create_autospec silently ignore misspelled arguments such as autospect, auto_spec and set_spec. This can lead to tests failing to check what they are supposed to check. This change adds a check causing a RuntimeError if the above functions get any of the above misspellings as arguments. It also adds a new argument, "unsafe", which can be set to True to disable this check. Also add "!r" to format specifiers in added error messages.
* bpo-36541: Add lib2to3 grammar PEP-570 pos-only arg parsing (GH-23759)Gregory P. Smith2020-12-142-6/+77
| | | | | | | | | Add positional only args support to lib2to3 pgen2. This adds 3.8's PEP-570 support to lib2to3's pgen2. lib2to3, while being deprecated is still used by things to parse all versions of Python code today. We need it to support parsing modern 3.8 and 3.9 constructs. Also add tests for complex *expr and **expr's.
* bpo-42635: Mark JUMP_ABSOLUTE at end of 'for' loop as artificial to avoid ↵Mark Shannon2020-12-141-0/+26
| | | | spurious line events. (GH-23761)
* Don't generate spurious line number in try-except-finally. (#23760)Mark Shannon2020-12-141-0/+17
|
* bpo-42195: Ensure consistency of Callable's __args__ in collections.abc and ↵kj2020-12-136-39/+159
| | | | typing (GH-23060)
* bpo-30858: Improve error location for expressions with assignments (GH-23753)Pablo Galindo2020-12-132-1/+8
| | | Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* bpo-39717: [tarfile] update nested exception raising (GH-23739)Ethan Furman2020-12-121-32/+33
| | | | - `from None` if the new exception uses, or doesn't need, the previous one - `from e` if the previous exception is still relevant
* bpo-42059: Fix required/optional keys for TypedDict(..., total=False) (GH-22736)Alex Grönholm2020-12-102-2/+6
|
* bpo-34750: [Enum] add `_EnumDict.update()` support (GH-23725)Ethan Furman2020-12-102-1/+39
| | | | | | | | | | | | | | | | This allows easier Enum construction in unusual cases, such as including dynamic member definitions into a class definition: # created dynamically foo_defines = {'FOO_CAT': 'aloof', 'BAR_DOG': 'friendly', 'FOO_HORSE': 'big'} class Foo(Enum): vars().update({ k: v for k, v in foo_defines.items() if k.startswith('FOO_') }) def upper(self): # example method return self.value.upper()
* bpo-42385: [Enum] add `_generate_next_value_` to StrEnum (GH-23735)Ethan Furman2020-12-102-0/+12
| | | The default for auto() is to return an integer, which doesn't work for `StrEnum`. The new `_generate_next_value_` for `StrEnum` returns the member name, lower cased.
* bpo-41877: Improve docs for assert misspellings check in mock (GH-23729)vabr-g2020-12-102-3/+4
| | | | | | | | | This is a follow-up to https://github.com/python/cpython/commit/4662fa9bfe4a849fe87bfb321d8ef0956c89a772. That original commit expanded guards against misspelling assertions on mocks. This follow-up updates the documentation and improves the error message by pointing out the potential cause and solution. Automerge-Triggered-By: GH:gpshead
* bpo-42517: [Enum] do not convert private names into members (GH-23722)Ethan Furman2020-12-102-1/+43
| | | private names, such as `_Color__hue` and `_Color__hue_` are now normal attributes, and do not become members nor raise exceptions
* bpo-42567: [Enum] call __init_subclass__ after members are added (GH-23714)Ethan Furman2020-12-102-2/+103
| | | | | When creating an Enum, type.__new__ calls __init_subclass__, but at that point the members have not been added. This patch suppresses the initial call, then manually calls the ancestor __init_subclass__ before returning the new Enum class.
* bpo-41439: Skip test_ssl and test_uuid tests if fork() is not supported ↵pxinwr2020-12-082-2/+2
| | | | (GH-21684)
* bpo-41443: Add more attribute checking in test_posix (GH-21688)pxinwr2020-12-081-3/+7
|
* [Enum] reformat and add doc strings (GH-23705)Ethan Furman2020-12-082-54/+135
|