summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
...
* Add more syslog tests (GH-97953)Serhiy Storchaka2022-10-073-7/+94
|
* gh-94808: Cover `%p` in `PyUnicode_FromFormat` (#96677)Nikita Sobolev2022-10-071-0/+19
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* Fix memory leaks in test_capi (#98017)Carl Meyer2022-10-071-0/+3
|
* gh-97983: Revert "Lay the foundation for further work in ↵Oleg Iarygin2022-10-071-129/+197
| | | | | | | | | | | | | | | | | | | | asyncio.test_streams: port server cases to IsolatedAsyncioTestCase" (#98015) This PR reverts gh-93369 and gh-97896 because they've made asyncio tests unstable. After these PRs were merged, random GitHub action jobs of random commits started to fail unrelated tests and test framework methods. The reverting is necessary because such shrapnel failures are a symptom of some underlying bug that must be found and fixed first. I had a hope that it's a server overload because we already have extremely rare disc access errors. However, one and a half day passed, and the failures continue to emerge both in PRs and commits. Affected issue: gh-93357. First reported in https://github.com/python/cpython/pull/97940#issuecomment-1270004134. * Revert "gh-93357: Port test cases to IsolatedAsyncioTestCase, part 2 (#97896)" This reverts commit 09aea94d291fed2f3e96558dcd6db04014c3e2fb. * Revert "gh-93357: Start porting asyncio server test cases to IsolatedAsyncioTestCase (#93369)" This reverts commit ce8fc186ac81bce1727bf4192205148daabf5c2e.
* gh-86298: Ensure that __loader__ and __spec__.loader agree in ↵Barry Warsaw2022-10-071-0/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | warnings.warn_explicit() (GH-97803) In `_warnings.c`, in the C equivalent of `warnings.warn_explicit()`, if the module globals are given (and not None), the warning will attempt to get the source line for the issued warning. To do this, it needs the module's loader. Previously, it would only look up `__loader__` in the module globals. In https://github.com/python/cpython/issues/86298 we want to defer to the `__spec__.loader` if available. The first step on this journey is to check that `loader == __spec__.loader` and issue another warning if it is not. This commit does that. Since this is a PoC, only manual testing for now. ```python # /tmp/foo.py import warnings import bar warnings.warn_explicit( 'warning!', RuntimeWarning, 'bar.py', 2, module='bar knee', module_globals=bar.__dict__, ) ``` ```python # /tmp/bar.py import sys import os import pathlib # __loader__ = pathlib.Path() ``` Then running this: `./python.exe -Wdefault /tmp/foo.py` Produces: ``` bar.py:2: RuntimeWarning: warning! import os ``` Uncomment the `__loader__ = ` line in `bar.py` and try it again: ``` sys:1: ImportWarning: Module bar; __loader__ != __spec__.loader (<_frozen_importlib_external.SourceFileLoader object at 0x109f7dfa0> != PosixPath('.')) bar.py:2: RuntimeWarning: warning! import os ``` Automerge-Triggered-By: GH:warsaw
* gh-97850: Remove deprecated functions from `importlib.utils` (#97898)Nikita Sobolev2022-10-073-233/+1
| | | | | * gh-97850: Remove deprecated functions from `importlib.utils` * Rebase and remove `set_package` from diff
* GH-90985: Revert "Deprecate passing a message into cancel()" (#97999)Guido van Rossum2022-10-072-57/+9
| | | | | Reason: we were too hasty in deprecating this. We shouldn't deprecate it before we have a replacement.
* bpo-35540 dataclasses.asdict now supports defaultdict fields (gh-32056)Tiger2022-10-071-2/+19
|
* GH-91052: Add C API for watching dictionaries (GH-31787)Carl Meyer2022-10-071-0/+132
|
* GH-97002: Prevent `_PyInterpreterFrame`s from backing more than one ↵Brandt Bucher2022-10-061-0/+65
| | | | `PyFrameObject` (GH-97996)
* gh-65961: Do not rely solely on `__cached__` (GH-97990)Brett Cannon2022-10-063-1/+75
| | | Make sure `__spec__.cached` (at minimum) can be used.
* gh-97781: Apply changes from importlib_metadata 5. (GH-97785)Jason R. Coombs2022-10-062-66/+0
| | | | | | | * gh-97781: Apply changes from importlib_metadata 5. * Apply changes from upstream * Apply changes from upstream.
* gh-94808: Coverage: Test that maximum indentation level is handled (#95926)Michael Droettboom2022-10-061-1/+21
| | | | | * gh-94808: Coverage: Test that maximum indentation level is handled * Use "compile" rather than "exec"
* gh-97897: Prevent os.mkfifo and os.mknod segfaults with macOS 13 SDK (GH-97944)Ned Deily2022-10-061-0/+22
| | | | | | | | The macOS 13 SDK includes support for the `mkfifoat` and `mknodat` system calls. Using the `dir_fd` option with either `os.mkfifo` or `os.mknod` could result in a segfault if cpython is built with the macOS 13 SDK but run on an earlier version of macOS. Prevent this by adding runtime support for detection of these system calls ("weaklinking") as is done for other newer syscalls on macOS.
* gh-94808: Cover `PyUnicode_Count` in CAPI (#96929)Nikita Sobolev2022-10-061-0/+38
|
* gh-94808: Cover `PyObject_PyBytes` case with custom `__bytes__` method (#96610)Nikita Sobolev2022-10-061-0/+16
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-96865: [Enum] fix Flag to use CONFORM boundary (GH-97528)Ethan Furman2022-10-051-1/+1
|
* gh-65961: Raise `DeprecationWarning` when `__package__` differs from ↵Brett Cannon2022-10-052-65/+2
| | | | | | | `__spec__.parent` (#97879) Also remove `importlib.util.set_package()` which was already slated for removal. Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* gh-97850: Remove all known instances of module_repr() (#97876)Barry Warsaw2022-10-053-13/+1
| | | Remove all known instances of module_repr()
* gh-88050: Fix asyncio subprocess to kill process cleanly when process is ↵Kumar Aditya2022-10-051-0/+25
| | | | blocked (#32073)
* gh-93357: Port test cases to IsolatedAsyncioTestCase, part 2 (#97896)Oleg Iarygin2022-10-051-29/+15
| | | This fixes the buildbots.
* gh-95196: Disable incorrect pickling of the C implemented classmethod ↵Serhiy Storchaka2022-10-051-0/+18
| | | | descriptors (GH-96383)
* gh-74696: Pass root_dir to custom archivers which support it (GH-94251)Serhiy Storchaka2022-10-051-6/+43
| | | | Co-authored-by: Éric <merwok@netwok.org>
* gh-87092: bring compiler code closer to a preprocessing-opt-assembler ↵Irit Katriel2022-10-051-1/+13
| | | | organisation (GH-97644)
* GH-96704: Add {Task,Handle}.get_context(), use it in ↵Guido van Rossum2022-10-052-0/+52
| | | | | call_exception_handler() (#96756) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-97825: fix AttributeError when calling ↵andrei kulakov2022-10-051-0/+6
| | | | | subprocess.check_output(input=None) with encoding or errors args (#97826) * fix AttributeError, add unit test
* GH-91079: Decouple C stack overflow checks from Python recursion checks. ↵Mark Shannon2022-10-059-24/+61
| | | | (GH-96510)
* GH-97779: Ensure that *all* frame objects are backed by "complete" frames ↵Brandt Bucher2022-10-051-0/+33
| | | | (GH-97845)
* gh-97837: Change deprecation warning message in `unittest` (#97838)Nikita Sobolev2022-10-052-6/+28
|
* gh-58451: Add optional delete_on_close parameter to NamedTemporaryFile ↵Ev2geny2022-10-041-1/+99
| | | | (GH-97015)
* gh-97008: Add a Python implementation of AttributeError and NameError ↵Łukasz Langa2022-10-043-519/+50498
| | | | | | | | | suggestions (#97022) Relevant tests moved from test_exceptions to test_traceback to be able to compare both implementations. Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
* gh-93357: Start porting asyncio server test cases to IsolatedAsyncioTestCase ↵Oleg Iarygin2022-10-041-173/+119
| | | | | (#93369) Lay the foundation for further work in `asyncio.test_streams`.
* gh-96142: add missing params to `dataclass._DataclassParams` (gh-96382)Nikita Sobolev2022-10-041-0/+26
|
* gh-97670: Remove sys.getdxp() and analyze_dxp.py script (#97671)Victor Stinner2022-10-041-8/+1
| | | | | | | Remove the sys.getdxp() function and the Tools/scripts/analyze_dxp.py script. DXP stands for "dynamic execution pairs". They were related to DYNAMIC_EXECUTION_PROFILE and DXPAIRS macros which have been removed in Python 3.11. Python can now be built with "./configure --enable-pystats" to gather statistics on Python opcodes.
* gh-97669: Remove outdated example scripts (#97675)Victor Stinner2022-10-044-506/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove outdated example scripts of the Tools/scripts/ directory. A copy can be found in the old-demos project: https://github.com/gvanrossum/old-demos Removed scripts (39): * byext.py * byteyears.py * cleanfuture.py * copytime.py * crlf.py * db2pickle.py * dutree.doc * dutree.py * find-uname.py * find_recursionlimit.py * finddiv.py * findlinksto.py * findnocoding.py * fixcid.py * fixdiv.py * fixheader.py * fixnotice.py * fixps.py * get-remote-certificate.py * google.py * highlight.py * ifdef.py * import_diagnostics.py * lfcr.py * linktree.py * lll.py * mailerdaemon.py * make_ctype.py * mkreal.py * objgraph.py * pdeps.py * pickle2db.py * pindent.py * pysource.py * reindent-rst.py * rgrep.py * suff.py * texi2html.py * which.py Changes: * Remove test_fixcid, test_lll, test_pdeps and test_pindent of test.test_tools. * Remove get-remote-certificate.py changelog entry, since the script was removed. Note: there is a copy of crlf.py in Lib/test/test_lib2to3/data/.
* Remove space. (GH-97807)Benjamin Peterson2022-10-041-1/+1
| | | Automerge-Triggered-By: GH:benjaminp
* GH-97752: Clear the `previous` member of newly-created generator/coroutine ↵Brandt Bucher2022-10-031-0/+19
| | | | frames (GH-97795)
* gh-96512: Move int_max_str_digits setting to PyConfig (#96944)Gregory P. Smith2022-10-034-1/+59
| | | | | | | | | | | It had to live as a global outside of PyConfig for stable ABI reasons in the pre-3.12 backports. This removes the `_Py_global_config_int_max_str_digits` and gets rid of the equivalent field in the internal `struct _is PyInterpreterState` as code can just use the existing nested config struct within that. Adds tests to verify unique settings and configs in subinterpreters.
* gh-94808: Coverage: Check picklablability of calliter (#95923)Michael Droettboom2022-10-031-10/+11
|
* gh-94808: Add test coverage for PyObject_HasAttrString (#96627)MonadChains2022-10-031-0/+14
| | | | | | | * gh-94808: Add test for HasAttrString * Harmonize to Python C code style guidelines * Add check to verify no exception thrown
* gh-97728: Argument Clinic: Fix uninitialized variable in the Py_UNICODE ↵Serhiy Storchaka2022-10-031-6/+6
| | | | | | | converter (GH-97729) It affects function os.system() on Windows and Windows-specific modules winreg, _winapi, _overlapped, and _msi.
* gh-96819: multiprocessing.resource_tracker: check if length of pipe write <= ↵Koki Saito2022-10-031-0/+8
| | | | | 512 (#96890) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-97706: multiprocessing tests: Delete unused variable `rand` (#97707)Koki Saito2022-10-031-2/+1
|
* gh-97591: In `Exception.__setstate__()` acquire strong references before ↵Ofey Chan2022-10-021-0/+25
| | | | calling `tp_hash` slot (#97700)
* gh-90908: Document asyncio.Task.cancelling() and asyncio.Task.uncancel() ↵Łukasz Langa2022-10-011-4/+124
| | | | | | (#95253) Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* GH-97592: Fix crash in C remove_done_callback due to evil code (#97660)Guido van Rossum2022-09-301-0/+15
| | | | Evil code could cause fut_callbacks to be cleared when PyObject_RichCompareBool is called.
* gh-96348: Deprecate the 3-arg signature of coroutine.throw and ↵Ofey Chan2022-09-305-13/+54
| | | | generator.throw (GH-96428)
* gh-97616: list_resize() checks for integer overflow (#97617)Victor Stinner2022-09-281-0/+13
| | | | | | | | Fix multiplying a list by an integer (list *= int): detect the integer overflow when the new allocated length is close to the maximum size. Issue reported by Jordan Limor. list_resize() now checks for integer overflow before multiplying the new allocated length by the list item size (sizeof(PyObject*)).
* gh-96670: Raise SyntaxError when parsing NULL bytes (#97594)Pablo Galindo Salgado2022-09-274-6/+21
|
* gh-73588: Fix generation of the default name of tkinter.Checkbutton. (GH-97547)Serhiy Storchaka2022-09-272-0/+41
| | | | | | Previously, checkbuttons in different parent widgets could have the same short name and share the same state if arguments "name" and "variable" are not specified. Now they are globally unique.