repo
stringclasses
1 value
instance_id
stringlengths
20
22
problem_statement
stringlengths
126
60.8k
merge_commit
stringlengths
40
40
base_commit
stringlengths
40
40
python/cpython
python__cpython-104788
# Optimize and reduce memory usage for `asyncio.Task` and others Tracker issue for performance work related to `asyncio.Task` for 3.13. Two things of top of my head is to use bitfields and use newer managed dict optimization in `_asyncio`. I'll add whatsnew entry once all changes land under this issue. <!-- gh-...
829ac13b69a2b53153e1b40670e6ef82f05130c1
8da9d1b16319f4a6bd78435016ef1f4bef6e2b41
python/cpython
python__cpython-104891
# Remove kwargs-based TypedDict creation #90224 deprecated the creation of TypedDicts through the kwargs-based syntax (`TypedDict("TD", a=int, b=str)`). The syntax is to be removed in 3.13, so now is the time to do that. <!-- gh-linked-prs --> ### Linked PRs * gh-104891 <!-- /gh-linked-prs -->
fea8632ec69d160a11b8ec506900c14989952bc1
d08679212d9af52dd074cd4a6abb440edb944c9c
python/cpython
python__cpython-104784
# Remove locale.resetlocale() function in Python 3.13 Remove locale.getdefaultlocale() and locale.resetlocale() functions deprecated in Python 3.11: see issue #90817 for the rationale and the deprecation. <!-- gh-linked-prs --> ### Linked PRs * gh-104784 * gh-105381 * gh-105401 <!-- /gh-linked-prs -->
0cb6b9b0db5df6b3f902e86eb3d4a1e504afb851
c7bf74bacd2b2db308e80e532153ffaf6dbca851
python/cpython
python__cpython-104781
# Remove the 2to3 program and the lib2to3 module The 2to3 program is implemented with the lib2to3 module which implements a parser of the Python language. Problem: this parser is unable to parse Python 3.10 grammar :-( This issue was already known in Python 3.9 when [PEP 617 – New PEG parser for CPython](https://peps....
ae00b810d1d3ad7f1f7e226b02ece37c986330e7
ddb14859535ab8091381b9d0baf32dbe245b5e65
python/cpython
python__cpython-104774
# PEP 594: Remove stdlib modules scheduled for deletion in Python 3.13 [PEP 594](https://peps.python.org/pep-0594/) ("Removing dead batteries from the standard library") deprecated the following 19 modules in Python 3.11 (or before) and their removal in Python 3.13: * [x] aifc * [x] audioop * [x] cgi * [x] cgitb...
7b00940f69ab26212ea375860a1956e157dd2c30
08d592389603500af398d278af4842cff6f22c33
python/cpython
python__cpython-104771
# Let generator.close() return StopIteration.value # Feature or enhancement Change the `close()` method of generators to return the value of `StopIteration`. # Pitch If a generator handles the `GeneratorExit` thrown by `close()`, it can exit gracefully, raising `StopIteration` with its return value. ```py ...
d56c933992c86986bd58eb3880aed0ed1b0cadc9
50fce89d123b25e53fa8a0303a169e8887154a0e
python/cpython
python__cpython-104765
# test_enum tests fail because of the version bump to 3.13.0a0 Following the creation of the 3.12 branch and the bump of main to 3.13, test_enum started failing (https://github.com/python/cpython/actions/runs/5050528705/jobs/9061352655). This seems to be because a few tests are testing features that haven't landed in ...
586aca3fc647c626c39e995d07d8bd7dd13e2d52
4194d8f2c40f478eb0fc9b6fa9b913baaff229da
python/cpython
python__cpython-126649
# AttributeError from stopping stopped patch which was started more than once # Bug report It seems, such bug appeared after https://github.com/python/cpython/commit/4b222c9491d1700e9bdd98e6889b8d0ea1c7321e Suppose we have initialized patch, than call `start` more than once and than call `stop` more than once: `...
1e40c5ba47780ddd91868abb3aa064f5ba3015e4
2e39d77ddeb51505d65fd54ccfcd72615c6b1927
python/cpython
python__cpython-104743
# tokenize.generate_tokens no longer reports lineno for indentation errors `tokenize.generate_tokens` raises an exception for indentation errors. It used to populate the `.lineno` attribute of the exception, but as of yesterday, `.lineno is None`. Test file: ```python # parsebug.py import io import sys import...
729b252241966f464cc46e176fb854dbcc5296cb
0a7796052acb9cec8b13f8d0a5f304f56f26ec5b
python/cpython
python__cpython-104722
# IDLE is unable to open any `.py` files With a fresh CPython build (be0c106789322273f1f76d232c768c09880a14bd), IDLE is unable to open any `.py` files. To reproduce: 1. Create an empty `.py` file with the name `repro.py` 2. Run `python -m idlelib repro.py` IDLE still seems able to create new `.py` files and ...
ffe47cb623999db05959ec4b5168d1c87a1e40ef
93923793f602ea9117f13bfac8cbe01a864eeb01
python/cpython
python__cpython-104700
# test_mmap are leaked Tried on current main branch. ```python ./python -m test -R 3:3 test_mmap Running Debug|x64 interpreter... 0:00:00 Run tests sequentially 0:00:00 [1/1] test_mmap beginning 6 repetitions 123456 ...... test_mmap leaked [13, 13, 13] references, sum=39 test_mmap failed (reference leak) ...
99b641886a09252bbcf99a1d322fa8734f1ca30d
b870b1fa755808977578e99bd42859c519e00bb7
python/cpython
python__cpython-104693
# Race condition during installation in parallel builds # Bug report When running `make -j install`, it is possible for the `python3` symlink to be installed before all standard library modules are installed. If an external program tries to run Python at this moment it can lead to an execution error. We are gett...
990cb3676c2edb7e5787372d6cbe360a73367f4c
81c81328a4fa13fead6f8cc9053a1a32a62a0279
python/cpython
python__cpython-104826
# Threads started in exit handler are still running after their thread states are destroyed Reproduced on main (663c049ff78a299bdf7c1a0444b9900e6d37372d), bisected to 283ab0e1c0. ```python import atexit import threading def t0(): pass def t1(): threading.Thread(target=t0).start() def f(): th...
ce558e69d4087dd3653207de78345fbb8a2c7835
eaff9c39aa1a70d401521847cc35bec883ae9772
python/cpython
python__cpython-104708
# PEP 695 changed how class decorators are traced Commit 24d8b88420b81fc60aeb0cbcacef1e72d633824a ("gh-103763: Implement PEP 695 (#103764)") changed how nested class decorators are traced. Example file nightly-20230518.py: ```python def decorator(arg): def _dec(c): return c return _dec @de...
cd9748409aa877d6d9905730bf68f25cf7a6a723
64d1b44a5459605af3e8572d4febfde021315633
python/cpython
python__cpython-104647
# Modernise code in `Tools/clinic/` # Feature or enhancement Modernise some Python anachronisms in `Tools/clinic/`, to make the code more readable and maintainable. Some things that can be easily done: - [x] Use `dict` instead of `OrderedDict` (#104647) - [x] Simplify code like this by using the `str.removesuff...
02b60035ceb735c3f7dd5bb7dc6a1508748a7a8d
06eeee97e36aa6bb3d21d7cbc288763ae3a7b21e
python/cpython
python__cpython-104682
# Syntax highlighting issue in Turtle docs # Documentation A couple of function docs - https://docs.python.org/3/library/turtle.html#turtle.setposition - https://docs.python.org/3/library/turtle.html#turtle.pencolor - https://docs.python.org/3/library/turtle.html#turtle.fillcolor - https://docs.python.org/3/l...
2c97878bb8a09f5aba8bf413bb794f6efd5065df
ff7f7316326a19749c5d79f9e44acdbe7d54ac4e
python/cpython
python__cpython-104674
# The `PyOS_*` hooks interact poorly with subinterpreters `PyOS_InputHook` and `PyOS_ReadlineFunctionPointer` are globally-registered `input` hooks that have no way of recovering module-level state for the extensions that registered them. In practice, extensions like `readline` and `tkinter` get around this by using g...
357bed0bcd3c5d7c4a8caad451754a9a172aca3e
2c4e29e32260783207568dc8581d65f0022f773a
python/cpython
python__cpython-104665
# Plural vs Singular in enum documentation # Documentation Hi! I've just seen that classname in the example in the documentation for `IntEnum` (https://docs.python.org/3/library/enum.html#enum.IntEnum) is in the plural (`Numbers`) but for all the other enum examples a classname in the singular is used. Since a s...
3ac856e69734491ff8423020c700c9ae86ac9a08
27a7d5e1cd5b937d5f164fce572d442672f53065
python/cpython
python__cpython-104660
# Location and text of f-string unclosed quote error is incorrect Since the PEP 701 changes the error of unclosed triple quited f-string literals is now incorrect: ``` x = 1 + 1 y = 2 + 2 z = f""" sdfjnsdfjsdf sdfsdfs{1+ 2}dfigdf {3+ 4}sdufsd "" ``` Executing this file will show: ``` File "/Users/...
ff7f7316326a19749c5d79f9e44acdbe7d54ac4e
663c049ff78a299bdf7c1a0444b9900e6d37372d
python/cpython
python__cpython-104657
# PEP 695: Rename typeparams to type_params in AST PEP-695 introduces a few new AST attributes that are currently called `typeparams`, as specified in https://peps.python.org/pep-0695/#ast-changes. However, @AlexWaygood rightly points out (https://github.com/python/cpython/pull/104642#discussion_r1198996246) that `typ...
a5f244d627a6815cf2d8ccec836b9b52eb3e8de2
ef5d00a59207a63c6d5ae0d5d44054847d1bf3b5
python/cpython
python__cpython-104646
# marshal tests are sloppy with error checking pymarshal_write_long_to_file and pymarshal_write_object_to_file pretend that PyMarshal_WriteLongToFile/PyMarshal_WriteObjectToFile can set an error. pymarshal_read_last_object_from_file and pymarshal_read_object_from_file don't check for errors so they can call Py_Buil...
ac56a854b418d35ad3838f3072604227dc718fca
8f1f3b9abdaa3e9d19aad22d6c310eb1f05ae5c2
python/cpython
python__cpython-104641
# Walrus in comprehension can leak into PEP 695 scope Example: ```pycon >>> class B: pass ... >>> class X[T]([(x := 3) for _ in range(2)] and B): print(x) ... 3 ``` This is because a walrus in a comprehension assigns to the immediately enclosing scope, which is now the type parameter scope. I don't think...
8a8853af24b41a73653d07dcc2f44d05b10e0673
ab8f54668b0c49186f1da8e127e303ca73220017
python/cpython
python__cpython-104630
# Clinic test are skipped on Windows `test_clinic` is skipped on Windows. This is a regression introduced by gh-96178. - The `Modules/_testclinic.c` helper extension module is not included in the Windows build - `test.support.import_helper.import_module("_testclinic")` fails and skips the whole test, since `_testc...
86ee49f469b84e4b746526a00d8191d0e374a268
b9dce3aec46bf5190400bd8239fdd4ea9e64d674
python/cpython
python__cpython-104624
# Bump SQLite to 3.42.0 on Windows and macOS installers SQLite 3.42.0 was [released recently](https://sqlite.org/releaselog/3_42_0.html). Let's just bump the installers now. If patch releases appear (they probably will), we can just bump those during the beta. See also https://github.com/python/cpython/issues/10299...
fd04bfeaf7a4531120ad450dbd1afc121a2523ee
70c77964778817907fbcc2a047a2abad4eb6e127
python/cpython
python__cpython-107184
# Subinterpreters can load modules without subinterpreter support The first time a subinterpreter attempts to import a module without proper subinterpreter support, an `ImportError` is raised (which is correct). However, *subsequent* imports of the same module succeed! Using `readline` as an example, since it's cur...
017f047183fa33743f7e36c5c360f5c670032be3
bcdd3072316181b49d94567bb648825a07ca9ae1
python/cpython
python__cpython-104637
# PEP 709: Comprehension iteration variable leaks into outer locals() Code: ```python def __b(): [__a for __b in [__b] for _ in []] return locals() ``` On #104603, calling this gives: ``` >>> __b() {'__b': <function __b at 0x100e3e390>} ``` But on 3.11: ``` >>> __b() {} ``` So the loc...
70c77964778817907fbcc2a047a2abad4eb6e127
86e6f16ccb97f66f2b9a31191ce347dca499d48c
python/cpython
python__cpython-104620
# compiler can incorrectly optimize a run of stores to the same name preceded by a SWAP If the `apply_static_swaps` optimization in the compiler sees the instruction sequence `SWAP 2; STORE_FAST a; STORE_FAST a`, it will optimize that by removing the `SWAP` and swapping the two instructions, resulting in `STORE_FAST a...
0589c6a4d3d822cace42050198cb9a5e99c879ad
dcdc90d384723920e8dea0ee04eae8c219333634
python/cpython
python__cpython-105122
# Type object's ob_type does not get set when tp_bases is set before PyType_Ready <!-- If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not the right place to seek help. Consider the following options instead: - reading the Python tutorial: ...
146939306adcff706ebddb047f7470d148125cdf
3698fda06eefb3c01e78c4c07f46fcdd0559e0f6
python/cpython
python__cpython-104651
# Remove the `PREDICT` macros. The `PREDICT()` macros are supposed to speed dispatch on platforms without computed gotos (i.e. Windows). However the "predictions" are nothing like the actual [behavior observed](https://github.com/faster-cpython/ideas/blob/main/stats/pystats-2023-05-14-python-7d2deaf.md#pair-counts), ...
064de0e3fca014e5225830a35766fb7867cbf403
d63a7c3694d5c4484fcaa01c33590b1d4bc2559e
python/cpython
python__cpython-104603
# PEP 709: Crash with lambda + nested scope This crashes on main: ```python def a(): def a(): [(lambda : b) for b in [a]] print(b) ``` The original reproducer (found with my fork of https://github.com/carljm/compgenerator) was ```python class a: def a(): class a: ...
dbe171e6098fbb96beed81db2c34f6428109e005
8a8853af24b41a73653d07dcc2f44d05b10e0673
python/cpython
python__cpython-104601
# function.__type_params__ and type.__type_params__ should be writable The PEP-695 implementation added a new attribute `__type_params__` to functions. I made this field read-only, but I realized there is a use case for writing to it: `functools.wraps`, when wrapping a generic function, should add the `.__type_params_...
3fadd7d5857842fc5cddd4c496b73161b0bcb421
f7835fc7e9617cefd87e72002916e258f589c857
python/cpython
python__cpython-105100
# Pluggable optimizer API We need an API for optimizers to be plugged in to CPython. The proposed model is that of client server, where the VM is the client and the optimizer is the server. The optimizer registers with the VM, then VM calls the optimizer when hotspots are detected. The API: ```C type struct...
4bfa01b9d911ce9358cf1a453bee15554f8e4c07
601ae09f0c8eda213b9050892f5ce9b91f0aa522
python/cpython
python__cpython-104581
# Remove `eval_breaker` and `kwnames` local variables from interpreter definition. Currently there are quite a few local variables in `PyEval_EvalDefault()`. Each of these is: * A candidate for register allocation, confusing the compiler. * Potentially adds extra state to the interpreter * Adds complexity to autom...
68b5f08b72e02f62ec787bfbb7aa99bac661daec
662aede68b0ea222cf3db4715b310e91c51b665f
python/cpython
python__cpython-104573
# Error message for walrus etc. in PEP 695 contexts could be improved Before: ``` >>> type A[T: (x:=3)] = int File "<stdin>", line 1 SyntaxError: 'named expression' can not be used within a TypeVar bound ``` After: ``` >>> type A[T: (x:=3)] = int File "<stdin>", line 1 SyntaxError: named expression...
97db2f3e07bf7d56750e215e4f32653bf3867ef8
0cb2fdc6217aa7c04b5c798cfd195c8d0f4af353
python/cpython
python__cpython-104556
# Typing: runtime-checkable protocols are broken on `main` PEP-695 protocols don't work as intended: Here's the behaviour you get with protocols that use pre-PEP 695 syntax, which is correct: ```pycon >>> from typing import Protocol, runtime_checkable, TypeVar >>> T_co = TypeVar("T_co", covariant=True) >>> @r...
1163782868454287ca9ac170aaebca4beeb83192
f40890b124a330b589c8093127be1274e15dbd7f
python/cpython
python__cpython-104605
# RTSPS scheme support in urllib.parse In accordance with https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml There are three valid RTSP schemes: URI Scheme | Description | Status | Reference -- | -- | -- | -- rtsp | Real-Time Streaming Protocol (RTSP) | Permanent | [RFC2326][RFC7826] rtsps | ...
f3266c05b6186ab6d1db0799c06b8f76aefe7cf1
4cefe3cf10f498c0927ae4fdba4880d5a64826e4
python/cpython
python__cpython-104550
# TypeAliasType should have a __module__ Currently the `__module__` attribute of TypeAliasType instances (created through `type X = ...`) is always `"typing"`. Let's set it to the actual module. <!-- gh-linked-prs --> ### Linked PRs * gh-104550 <!-- /gh-linked-prs -->
b9dce3aec46bf5190400bd8239fdd4ea9e64d674
1c55e8d00728ceabd97cd1a5bd4906c9875a80c6
python/cpython
python__cpython-104537
# multiprocessing.process._children is not multithread-safe, BaseProcess.close() function would cause AttributeError <!-- If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not the right place to seek help. Consider the following options instead: ...
ef5d00a59207a63c6d5ae0d5d44054847d1bf3b5
b9c807a260f63284f16e25b5e98e18191f61a05f
python/cpython
python__cpython-104531
# Switch Python to using native Win32 condition variables `Py_HAVE_CONDVAR` denotes support for Python condition variable APIs. On Win32, the `_PY_EMULATED_WIN_CV` macro exists to allow condition variables to be emulated using Win32 critical section and semaphore APIs. [Native Win32 support for condition variables]...
b3f0b698daf2438a6e59d5d19ccb34acdba0bffc
d29f57f6036353b4e705a42637177442bf7e07e5
python/cpython
python__cpython-104857
# zipfile.write should check that it isn't appending an archive to itself A common use pattern for zipfile is to recursively compress an entire directory into a single .zip file. A common implementation of this pattern looks like this: ```python #!/usr/bin/env python3 import zipfile, pathlib rootpath=pathlib.P...
42fabc3ea767f10989363536eaaa9da32616ab57
c9e231de8551ab6d06c92dfa95033150e52d7f1f
python/cpython
python__cpython-104516
# Ref leaks introduced by _io isolation (gh-101948) Tried on current main. ```python ./python -m test -R 3:3 test_nntplib 0:00:00 load avg: 2.49 Run tests sequentially 0:00:00 load avg: 2.49 [1/1] test_nntplib beginning 6 repetitions 123456 ...... test_nntplib leaked [1222, 1220, 1222] references, sum=3664 te...
442a3e65da2594bedee88a3e81338d86926bde56
0bb61dd5b0ffc248e18f1b33cddd18788f28e60a
python/cpython
python__cpython-108090
# Run `mypy` on `cases_generator` # Feature or enhancement After https://github.com/python/cpython/pull/104421 is merged, we now have the precedent and the needed infrastructure to run `mypy` on things that support type annotations in `Tools/` # Pitch Maybe we should run it on `Tools/cases_generator`? It has ...
28cab71f954f3a14de9f474ce9c4abbd23c97862
fd195092204aa7fc9f13c5c6d423bc723d0b3520
python/cpython
python__cpython-104591
# IDLE: completions toplevel blank on Tk Aqua 8.7 https://github.com/python/cpython/blob/27d8ecd7f3325a40a967d2d6b6b36b21d5328753/Lib/idlelib/autocomplete_w.py#L185-L190 Using `wm geometry` to move an overrideredirect toplevel far enough offscreen triggers a strange bug in recent Tk Aqua 8.7 (assuming it isn’t actu...
678bf57ed04b8c250f0bc031ebd264bece76e731
7fc8e2d4627cdba5cb0075c9052ed6f4b6ecd36d
python/cpython
python__cpython-104789
# Tkinter: Tk 8.7 alphabetizes options in certain error messages As done by e.g. https://core.tcl-lang.org/tk/info/b7db31b3a38b and causing this Tkinter test to fail: ``` ====================================================================== FAIL: test_configure_type (test.test_tkinter.test_widgets.MenuTest.test_...
897e716d03d559a10dd5015ecb501ceb98955f3a
a989b73e8ebf869dcc71d06127e8797c92260a0f
python/cpython
python__cpython-104585
# Tkinter, IDLE: Future Tcl and Tk can have differing version/patchlevel ~~Tk 8.7 will be compatible with both Tcl 8.7 and Tcl 9.0; there is no Tk 9.0 currently in development. The version and/or patchlevel of Tcl and Tk will not necessarily be identical~~, but there are places in Tkinter code which assume they are. A...
aed643baa968b4959b830d37750080cac546fba7
c649df63e0d052044a4660101d5769ff46ae9234
python/cpython
python__cpython-104495
# Tkinter: Tk 8.7 quotes pathnames in certain error messages Tk 8.7 (as of https://core.tcl-lang.org/tk/info/2991150c09f6) adds quotes around window pathnames in a few error messages, including those triggered by two Tkinter tests, causing them to fail: ``` =========================================================...
3cba61f111db9b5e8ef35632915309f81fff8c6c
9d41f83c58e6dc2fc6eb4b91f803551850b0adeb
python/cpython
python__cpython-104493
# Move BOLT autoconf logic after PGO # Feature or enhancement Just a simple refactor to tee us up for better BOLT / PGO integration in the build system. <!-- gh-linked-prs --> ### Linked PRs * gh-104493 <!-- /gh-linked-prs -->
27d8ecd7f3325a40a967d2d6b6b36b21d5328753
48b3617de491f00a3bf978b355074cc8e228d61b
python/cpython
python__cpython-104491
# Handle virtual / phony make targets consistently and more robustly # Feature or enhancement I already typed a detailed commit message explaining this. Will be explained by forthcoming PR linking to this issue. <!-- gh-linked-prs --> ### Linked PRs * gh-104491 <!-- /gh-linked-prs -->
a6bcc8fb92ffb75bb1907cc568ba9fff516979c3
b15a1a6ac6ea0d7792036e639e90f0e51400c2ee
python/cpython
python__cpython-104488
# PYTHON_FOR_REGEN only works with Python 3.10 or newer On current `main`, `PYTHON_FOR_REGEN` only works with Python 3.10 or newer. Previously, we've tried to maintain backwards compatibility with older Python versions in our build system. Last time we adjusted `PYTHON_FOR_REGEN` (gh-98988), we deliberately did not...
146106a0f1cc61815fa33f0d3f808a3e3e3275be
27d8ecd7f3325a40a967d2d6b6b36b21d5328753
python/cpython
python__cpython-104565
# Add case_sensitive argument to `pathlib.PurePath.match()` In #81079 we added a *case_sensitive* argument to `pathlib.Path.glob()` and `rglob()`. It would be good to have this functionality available in the closely-related `PurePath.match()` method. The rationale is much the same: this argument is useful when dealing...
dcdc90d384723920e8dea0ee04eae8c219333634
cfa517d5a68bae24cbe8d9fe6b8e0d4935e507d2
python/cpython
python__cpython-104483
# Error handling bugs in ast.c in validate_pattern, there are two places where in case of error we break out of a loop, but we also need to break out of the switch. ``` --- a/Python/ast.c +++ b/Python/ast.c @@ -580,7 +580,9 @@ validate_pattern(struct validator *state, pattern_ty p, int star_ok) ...
8a3702f0c79e5a99fcef61e35724f4b9ea3453b8
26baa747c2ebc2beeff769bb07b5fb5a51ad5f4b
python/cpython
python__cpython-104681
# Floating point tutorial: "today (November 2000)" # Documentation It [says](https://docs.python.org/3.11/tutorial/floatingpoint.html?highlight=floating#representation-error): > Almost all machines today (November 2000) use IEEE-754 floating point arithmetic, and almost all platforms map Python floats to IEEE-75...
2cf04e455d8f087bd08cd1d43751007b5e41b3c5
3f9c60f51ef820937e7e0f95f45e63fa0ae21e6c
python/cpython
python__cpython-104667
# ASAN failure was detected while running test_threading See: https://github.com/python/cpython/actions/runs/4971544925/jobs/8896154582 Unicodeobject looks quite related. ````` 2023-05-14T09:18:05.5991524Z Direct leak of 1702 byte(s) in 27 object(s) allocated from: 2023-05-14T09:18:05.5991966Z #0 0x7fb1e48...
c3f43bfb4bec39ff8f2c36d861a3c3a243bcb3af
625887e6df5dbebe48be172b424ba519e2ba2ddc
python/cpython
python__cpython-104470
# Improve the readability and maintainability of test_capi using the AC Currently, most of test_capi modules do not use the Argument Clinic tool. As a result, we manually implement docstrings containing explanations for the test codes and handle parameter parsing manually: `PyArg_ParseTuple` . To maintain code cons...
48b3617de491f00a3bf978b355074cc8e228d61b
2cd1c87d2a23ffd00730b5d1648304593530326c
python/cpython
python__cpython-104462
# Tkinter: test_configure_screen should only run on X11 test_configure_screen uses the `DISPLAY` environment variable, which is only relevant to X11; and the purpose of the test is to set the `-screen` option for a toplevel, which is only useful on Tk for X11, since Tk for the Win32 or Aqua windowing systems only supp...
fdafdc235e74f2f4fedc1f745bf8b90141daa162
456d56698db6c6287500f591927c900a5f5221ca
python/cpython
python__cpython-104457
# test_ctypes are leaked Tried on last commit. ```python PS C:\Users\KIRILL-1\CLionProjects\cpython> ./python -m test -R 3:3 test_ctypes Running Debug|x64 interpreter... 0:00:00 Run tests sequentially 0:00:00 [1/1] test_ctypes beginning 6 repetitions 123456 a=5, b=10, c=15 a=5, b=10, c=15 .a=5, b=10, c=...
2cd1c87d2a23ffd00730b5d1648304593530326c
fb8739f0b6291fb048a94d6312f59ba4d10a20ca
python/cpython
python__cpython-104455
# test_exceptions are leaked Tried on [last commit](https://github.com/python/cpython/commit/46f1c78eebe08e96ed29d364b1804dd37364831d) ```python PS C:\Users\KIRILL-1\CLionProjects\cpython> ./python -m test -R 3:3 test_exceptions Running Debug|x64 interpreter... 0:00:00 Run tests sequentially 0:00:00 [1/1] test_ex...
7d2deafb73237a2175971a26cfb544974661de4b
46f1c78eebe08e96ed29d364b1804dd37364831d
python/cpython
python__cpython-104433
# UBSan misaligned load errors in `gethost_common()`, `mkgrent()` test.test_asyncio.test_events.KqueueEventLoopTests.test_create_connection triggers `-fsanitize=alignment` errors on macOS (i.e. Darwin): ``` Modules/socketmodule.c:5790:34: runtime error: load of misaligned address 0x60d0001ca152 for type 'char *', ...
f01e4cedba1a17d321664834bb255d9d04ad16ce
983305268e2291b0a7835621b81bf40cba7c27f3
python/cpython
python__cpython-104416
# `test_typing` fails refleak tests Repro: `./python.exe -m test -R 3:3 -v test_typing` The first test round passes, but the second one fails with: ```python ====================================================================== FAIL: test_bytestring (test.test_typing.CollectionsAbcTests.test_bytestring) ----...
5b8cd5abe5924646b9ed90e7ba90085b56d5f634
d50c37d8adb2d2da9808089d959ca7d6791ac59f
python/cpython
python__cpython-104414
# Refleak in LOAD_SUPER_ATTR_ATTR The buildbots show a refleak in test_super. I narrowed it down to this: ```python """Unit tests for zero-argument super() & related machinery.""" import unittest class TestSuper(unittest.TestCase): def test_attribute_error(self): class C: def m...
718b13277217e90232da5edf7ab3267e59189698
a781484c8e9834538e5ee7b9e2e6bec7b679e033
python/cpython
python__cpython-104412
# Tkinter: test_getint incompatible with Tcl 9.0 [TIP 114](https://core.tcl-lang.org/tips/doc/trunk/tip/114.md) means that as of Tcl 9.0, integers are only treated as octal when the `0o` prefix is specified; a leading 0 by itself is no longer sufficient. This change partially breaks test_getint: ``` ==============...
2c49c759e880a32539f50c31dbd35d2bc4b4e030
8ddf0dd264acafda29dc587ab8393387bb9a76ab
python/cpython
python__cpython-104406
# Some instructions and specializations ignore PEP 523 Four instructions ignore PEP 523 when executing: - `BINARY_SUBSCR_GETITEM` - `FOR_ITER_GEN` - `SEND` - `SEND_GEN` Five instructions ignore it when specializing: - `BINARY_SUBSCR_GETITEM` - `FOR_ITER_GEN` - `LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN` - `LOAD...
1eb950ca55b3e0b6524b3f03b0b519723916eca2
a10b026f0fdceac42c4b928917894d77da996555
python/cpython
python__cpython-104442
# PEP 709 segfault with nested comprehensions plus lambdas This is another crasher related to PEP 709. ```python def f(): [([lambda: x for x in range(4)], lambda: x) for x in range(3)] ``` Stack trace: <details> ``` (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCE...
563c7dcba0ea1070698b77129628e9e1c86d34e2
1eb950ca55b3e0b6524b3f03b0b519723916eca2
python/cpython
python__cpython-104402
# pygettext: use an AST parser instead of a tokenizer Follow up on this [forum discussion](https://discuss.python.org/t/modernize-and-add-missing-features-to-pygettext/26455) This is a part 1/X of improving [pygettext](https://github.com/python/cpython/blob/main/Tools/i18n/pygettext.py). Replacing the tokenizer tha...
374abded070b861cc389d509937344073193c36a
1da412e574670cd8b48854112ba118c28ff2aba0
python/cpython
python__cpython-104407
# Tkinter uses deprecated functions `mp_to_unsigned_bin_n()` and `mp_unsigned_bin_size()` _tkinter.c currently uses the functions `mp_to_unsigned_bin_n()` and `mp_unsigned_bin_size()`, which were deprecated in libtommath 1.2.0 and replaced by new functions `mp_to_ubin()` and `mp_ubin_size()`. The deprecated funct...
00d73caf804c0474980e471347d6385757af975f
852348ab65783601e0844b6647ea033668b45c11
python/cpython
python__cpython-104397
# `uuid.py` checks platform for emscripten and wasi <!-- If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not the right place to seek help. Consider the following options instead: - reading the Python tutorial: https://docs.python.org/3/tuto...
434db68ee31514ddc4aa93f8dfc2eb874d3669c5
7d7dd4cd70ed997ed7c3cda867c4e7b1ab02b205
python/cpython
python__cpython-104443
# Add link to Download page on documentation index # Documentation In docs.python.org, there is no a obvious link to [download page](https://docs.python.org/3/download.html). I found one just in a question on FAQ section. So, I suggestion add a link on documentation index. I think a new entry on Meta Information...
90cf345ed42ae4d17d2a073718985eb3432a7c20
44c8699196c1951037bc549c895ea5af26c7254e
python/cpython
python__cpython-104393
# _paramspec_tvars in typing.py does nothing Several classes in typing.py pass around an attribute called `_paramspec_tvars`, but nothing depends on its value. It was added in b2f3f8e3d81 by @Fidget-Spinner to enforce some behavior around ParamSpec, but since then we have apparently loosened that behavior. Let's just ...
37a5d256b97bc9d2a0ff445997fec851e328ebad
434db68ee31514ddc4aa93f8dfc2eb874d3669c5
python/cpython
python__cpython-104390
# Make it possible to mark Argument Clinic args as unused For base classes, it is not unusual to create stubs for interface methods, and let those stubs simply raise an exception. It would be nice to be able to mark the arguments with Py\_UNUSED in those cases. Implementing this is straight-forward in clinic.py. CC...
b2c1b4da1935639cb89fbbad0ce170a1182537bd
15795b57d92ee6315b5c8263290944b16834b5f2
python/cpython
python__cpython-104394
# Segfault with lambda nested in comprehension ``` def gen_params(): def bound(): return [lambda: T for T in (T, [1])[1]] T = ... ``` This segfaults on current main. Stack trace: <details> ``` (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=...
ac66cc17f21653b66321b50d0a1f792982fca21f
37a5d256b97bc9d2a0ff445997fec851e328ebad
python/cpython
python__cpython-104376
# Pathlib docs use `versionadded` incorrectly The pathlib documentation uses `.. versionadded` blocks for new _arguments_. These should use `.. versionchanged`. <!-- gh-linked-prs --> ### Linked PRs * gh-104376 * gh-106058 <!-- /gh-linked-prs -->
4a6c84fc1ea8f26d84a0fbeeff6f8dedc32263d4
d2cbb6e918d9ea39f0dd44acb53270f2dac07454
python/cpython
python__cpython-104378
# PEP 688: Crash if `__release_buffer__` is called while an exception is active ``` class A: def __buffer__(self, flags): return memoryview(bytes(8)) def __release_buffer__(self, view): pass # do not need to do anything here, just needs to exist b = bytearray(8) m = memoryview(...
a0a98ddb31591357bead4694b21717cb4034924f
ac66cc17f21653b66321b50d0a1f792982fca21f
python/cpython
python__cpython-104361
# ssl docs still refer to removed module-level ssl.wrap_socket # Documentation ssl docs still refer to removed global ssl.wrap_socket https://github.com/python/cpython/blob/a7a2dbbf72aceef61bfb50901bfa39bfb8d6d229/Doc/library/ssl.rst?plain=1#L2456-L2458 <!-- gh-linked-prs --> ### Linked PRs * gh-104361 * gh-114...
127a49785247ac8af158b18e38b722e520054d71
51d9068ede41d49e86c9637960f212e2a0f07f4c
python/cpython
python__cpython-104368
# Comprehension inlining: Bug if comprehension contains a lambda Code sample: ```python def outer(x): return [lambda: x for x in range(x)] print([f() for f in outer(2)]) ``` On 3.11, this produces `[1, 1]` as expected. But on current main, I get: ``` >>> [f() for f in outer(2)] Traceback (most ...
fcd5fb49b1d71165f3c503c3d2e74a082ddb2f21
94f30c75576bb8a20724b2ac758fa33af089a522
python/cpython
python__cpython-104586
# Unhandled BrokenPipeError in asyncio.streams # Bug report Kind of a weird one here, been running into it a for a while but just recently figured out how to reproduce it reliably. Basically, if an async process is killed while a large amount of data remains to be written to its stdin, it fails to throw a `Conne...
7fc8e2d4627cdba5cb0075c9052ed6f4b6ecd36d
b27fe67f3c643e174c3619b669228ef34b6d87ee
python/cpython
python__cpython-104410
# gammavariate uses misleading parameter names. # Documentation for gammavariate The parameters of the `gammavariate` function (in `random` module) are `alpha`, `beta`. We can see, from the mathematical description given, that these correspond to _shape_ and _scale_. [Wikipedia conventionally describes these usi...
88c5c586708dcff369c49edae947d487a80f0346
2f7b5e458e9189fa1ffd44339848aa1e52add3fa
python/cpython
python__cpython-104335
# Bad error message when inheriting from Generic multiple times ``` >>> from typing import Generic, TypeVar >>> T = TypeVar("T") >>> U = TypeVar("U") >>> class X(Generic[T], Generic[U]): pass ... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/jelle/py/cpython/Lib/typin...
01c321ca34d99f35f174768c6f8c500801d4ef4c
2866e030f01dc3ff08de32857fa77d52468b676b
python/cpython
python__cpython-104311
# Add importlib.util.allowing_all_extensions() Per [PEP 684](https://peps.python.org/pep-0684/#restricting-extension-modules), we are providing `importlib.util.allowing_all_extensions()` as a context manager users may use to disable the strict compatablility checks. I'll be added docs for this separately from the c...
4541d1a0dba3ef0c386991cf54c4c3c411a364c0
5c9ee498c6f4b75e0e020f17b6860309c3b7e11e
python/cpython
python__cpython-104307
# socket.getnameinfo doesn't drop the GIL It should do that. Trivial fix is in #104307 but creating an issue to make bedevere happy. <!-- gh-linked-prs --> ### Linked PRs * gh-104307 * gh-104313 <!-- /gh-linked-prs -->
faf196213e60d8a90773e9e5680d3252bd294643
4541d1a0dba3ef0c386991cf54c4c3c411a364c0
python/cpython
python__cpython-104296
# Unable to generate POT for Python documentation <!-- If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not the right place to seek help. Consider the following options instead: - reading the Python tutorial: https://docs.python.org/3/tutori...
942482c8e660765f68098eae347d84b93e37661a
9af485436b83003b5705a6e54bdeb900c70e0c69
python/cpython
python__cpython-104283
# `lzma._decode_filter_properties` crashes with BCJ filter and buffer of zero length Example: ```python >>> import lzma >>> lzma._decode_filter_properties(lzma.FILTER_X86, b"") Segmentation fault (core dumped) ``` In `_lzma__decode_filter_properties_impl` call to `lzma_properties_decode` returns `LZMA_OK` and ...
0154405350c272833bd51f68138223655e142a37
b204c4beb44c1a9013f8da16984c9129374ed8c5
python/cpython
python__cpython-104277
# Use type flag instead of custom constructor in `_struct.unpack_iterator` Currently `_struct.unpack_iterator` type defines its own constructor just to report to user that it isn't instantiable (with a typo, by the way): https://github.com/python/cpython/blob/8d95012c95988dc517db6e09348aab996868699c/Modules/_struct...
c21f82876089f3e9a7b1e706c029664b799fa659
85f981880ae9591ba577e44d2945a771078a7c35
python/cpython
python__cpython-104274
# argparse: remove redundant len() # Feature or enhancement I decreased calling of redundant len() function. # Pitch (Explain why this feature or enhancement should be implemented and how it would be used. Add examples, if applicable.) # Previous discussion <!-- New features to Python should first ...
01cc9c1ff79bf18fe34c05c6cd573e79ff9487c3
ac020624b32820e8e6e272122b94883f8e75ac61
python/cpython
python__cpython-105406
# `glob.glob('**/**', recursive=True)` yields duplicate results Calling `glob.glob(pattern, recursive=True)`, where *pattern* contains two or more `**/` segments, can yield the same paths multiple times: ```python >>> import glob >>> len(glob.glob('**/**', recursive=True)) 314206 >>> len(set(glob.glob('**/**', ...
c06be6bbb8d138dde50c0a07cbd64496bee537c5
b8eaad30090b46f115dfed23266305b6546fb364
python/cpython
python__cpython-104266
# `_csv` `Reader` and `Writer` types shouldn't be directly instantiable The accepted way to create these objects is to use constructor functions `_csv.reader()` and `_csv.writer()` with appropriate arguments. Objects that are created through type constructors `_csv.Reader` and `_csv.Writer` turn out to be not properly...
06c2a4858b8806abc700a0471434067910db54ec
c0ece3dc9791694e960952ba74070efaaa79a676
python/cpython
python__cpython-104251
# Task object in asyncio docs is missing the "context" argument # Documentation the signature in the docs (https://docs.python.org/3/library/asyncio-task.html#asyncio.Task) and the description doesn't cover the *context* argument that was added in 3.11. <!-- gh-linked-prs --> ### Linked PRs * gh-104251 * gh-104258...
4ee2068c34bd45eddba7f6a8ee83f62d5b6932fc
42f54d1f9244784fec99e0610aa05a5051e594bb
python/cpython
python__cpython-104253
# Immortalize Py_EMPTY_KEYS The every dict has a keys "object", of type `PyDictKeysObject`. While it isn't actually a Python object, it does have a refcount, which is used to know when to free it. `PyDictKeysObject` (and the helpers, `dictkeys_incref()` and `dictkeys_decref()`) was not updated to be immortal when th...
b8f7ab5783b370004757af5a4c6e70c63dc5fe7a
2dcb289ed08980c8f97d538060b4ad8d5e82b56a
python/cpython
python__cpython-104241
# combine compilation steps in a pipeline Make it possible to chain compiler_codegen, optimize_cfg, assemble_code_object such that each stage takes the previous stage's output and collectively they do the same as compile(). <!-- gh-linked-prs --> ### Linked PRs * gh-104241 * gh-104300 <!-- /gh-linked-prs -->
2c2dc61e8d01f44e5b7e63dd99196460a80905f1
1b19bd1a88e6c410fc9cd08db48e0d35cfa8bb5a
python/cpython
python__cpython-104234
# New warning: unused variable ‘main_interp’ <img width="916" alt="Снимок экрана 2023-05-06 в 15 17 06" src="https://user-images.githubusercontent.com/4660275/236623527-548a597a-b226-464a-8bf7-3c10c69a21a1.png"> Here: https://github.com/python/cpython/blob/f5088006ca8e9654fbc3de119462f0ab764e408b/Python/ceval_gil....
6616710731b9ad1a4e6b73696e8bd5c40cf8762d
f5088006ca8e9654fbc3de119462f0ab764e408b
python/cpython
python__cpython-104227
# PEP 688: Cannot call super().__buffer__() The following will currently fail with a RecursionError: ``` class A(bytearray): def __buffer__(self, flags): return super().__buffer__(flags) a = A() mv = memoryview(a) ``` Thanks to @chilaxan for finding this, along with some related problems. I a...
405eacc1b87a42e19fd176131e70537f0539e05e
874010c6cab2e079069767619af2e0eab05ad0b2
python/cpython
python__cpython-104220
# Inplace dunders can return NotImplemented, and that's not documented See [this discussion](https://discuss.python.org/t/notimplemented-in-inplace-dunders/26536). Normal NotImplemented situation : `A() + B()` is resolved in `A.__add__(A(), B())` which if returning NotImplemented, falls back to `B.__radd__(B(), A())`...
2713c2abc8d0f30cd0060cd307bb4ec92f1f04bf
fee86fd9a422612b39e5aabf2571b8fe4abac770
python/cpython
python__cpython-104191
# usan failure on main https://buildbot.python.org/all/#/builders/719/builds/2611 ``` Include/object.h:227:12: runtime error: member access within address 0x7ffd008dd4d0 with insufficient space for an object of type 'PyObject' (aka 'struct _object') 0x7ffd008dd4d0: note: pointer points here 9d 7f 00 00 80 d9 a...
163034515a81f137d1dd7d289dc048eb0f1cd424
e5b8b19d99861c73ab76ee0175a685acf6082d7e
python/cpython
python__cpython-104217
# build fails with `--enable-pystats --with-pydebug` (use of Py_SIZE on PyLongObject) ``` > ./configure --enable-pystats --with-pydebug > make -j ... _bootstrap_python: ../../cpython/Include/object.h:215: Py_SIZE: Assertion `ob->ob_type != &PyLong_Type' failed. ``` It looks like #102464 missed removing this us...
afe7703744f813adb15719642444b5fd35888d86
82f789be3b15df5f6660f5fd0c563ad690ee00fb
python/cpython
python__cpython-104181
# Support detecting SOCKS proxy configuration on macOS # Feature or enhancement Allow `urllib.request.getproies()` to detect SOCKS proxies configured in macOS system settings. # Pitch `urllib.request.getproies()` is widely used, for example by `requests`, to detect proxy configurations from environment variab...
9a9b176eb7e052af84c01c0cfb3231e51f980f2d
bf89d4283a28dd00836f2c312a9255f543f93fc7
python/cpython
python__cpython-104170
# Improve tokenize error handling There has been quite a lot of instances were poor error handling in the tokenizer leads to crashes or errors being overwritten. We should not rely on continuous patches to every single individual issue but we should improve the situation with more robust infrastructure. <!-- gh-linke...
eba64d2afb4c429e80d863dc0dd7808bdbef30d3
e2ef5015d1b6cb56f1a7988583f2fb8c0e6d65fc
python/cpython
python__cpython-104147
# Remove dead code from clinic.py There's a bit of unused code in clinic.py. For example, the code that manipulated `second_pass_replacements` was removed in 2015 (commit 0759f84d6260bad1234b802212e73fdc5873d261, gh-67688 (bpo-23500)), but the variable and a branch depending on it still persists. Suggesting to remo...
9885677b0494e9be3eb8d7d69bebca0e79d8abcc
e95dd40aff35775efce4c03bec7d82f03711310b
python/cpython
python__cpython-104172
# bisect.bisect is not cross-referenced properly # Documentation The documentation page for bisect includes lots of interlinks to the bisect function but it appears that link isn't being resolved correctly by sphinx, whilst it thinks it is a function, it links to the module header To reproduce: https://docs.pyth...
76eef552f3653179782afcc5063f10560a6e1a80
921185ed050efbca2f0adeab79f676b7f8cc3660
python/cpython
python__cpython-104140
# Leverage eager tasks to optimize asyncio gather & TaskGroups further # Feature or enhancement gh-97696 introduced eager tasks factory, which speeds up some async-heavy workloads by up to 50% when opted in. installing the eager tasks factory applies out-of-the-box when gathering tasks (`asyncio.gather(...)`), a...
52d8f36e8c9f6048367d7bdfede3698e3f5f70d0
f3e7eb48f86057919c347f56dabf417acfd55845
python/cpython
python__cpython-104143
# `_Py_RefcntAdd` doesn't respect immortality This is used by `list` and `tuple` internally: ```py >>> import sys >>> sys.getrefcount(None) == (1 << 32) - 1 True >>> refs = [None] * 42 >>> sys.getrefcount(None) == (1 << 32) - 1 False >>> del refs >>> sys.getrefcount(None) == (1 << 32) - 1 True ``` I'll...
ce871fdc3a02e8441ad73b13f9fced308a9d9ad1
fa86a77589a06661fcebb806d36f3a7450e2aecf
python/cpython
python__cpython-104312
# urlunsplit for itms-services scheme returns invalid url Relating to a Werkzueg issue (https://github.com/pallets/werkzeug/issues/2691), when parsing an iOS App install url e.g. itms-services:action=download-manifest&url=https://theacmeinc.com/abcdefeg, urlunpslit returns an invalid url. e.g. ```from urllib.pa...
82f789be3b15df5f6660f5fd0c563ad690ee00fb
ca95edf177e3c10e10d7011ed52619b1312cf15e