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-118957 | # `jit.c` may be built with an incomplete `jit_stencils.h`
# Bug report
### Bug description:
As discussed in https://discuss.python.org/t/pep-744-jit-compilation/50756/42 and further with @brandtbucher, I've tried to change the Fedora's Python 3.13 package to utilize `--enable-experimental-jit=yes-off`.
As a starti... | 4702b7b5bdc07d046576b4126cf4e4f5f7145abb | ab73bcdf73fed5a23f2e2e37a63d6992f29479a9 |
python/cpython | python__cpython-119769 | # `PyEval_GetLocals()` leaks locals
# Bug report
`PyEval_GetLocals()` is documented as returning a [borrowed reference](https://docs.python.org/3/c-api/reflection.html#c.PyEval_GetLocals). It now returns a new reference, which causes callers to leak the local variables:
https://github.com/python/cpython/blob/35c4361... | e65cb4c6f01a687f451ad9db1600525e1c5832c4 | 162b41f57757c1df40eb377985e2e877fb0f0ea3 |
python/cpython | python__cpython-118946 | # ChainMap.__contains__ and .get performance improvement.
# Feature or enhancement
### Proposal:
```python
import collections as coll
class ChainMap2(coll.ChainMap):
def __contains__(self, key):
for mapping in self.maps:
if key in mapping:
return True
return False
... | cd4cfa6ed2fd5f866c7be339f1d3cf56aa4d2bad | 7e894c2f38f64aed9b259c8fd31880f1142a259d |
python/cpython | python__cpython-118929 | # sqlite3: disallow using a sequence of params with named placeholders
# Feature or enhancement
Follow-up of...:
- #101693:
> Based on the discussion in the above linked Discourse topic, I propose to now issue a deprecation warning if sequences are used with named placeholders. The deprecation warning should inform... | d8e0e009195b2388fb53012c1f0fa786426dc05f | 7a97ee570f361af27c59eb883b53425fef11c739 |
python/cpython | python__cpython-118925 | # Remove `sqlite3.version` and `sqlite3.version_info`
They were deprecated in 3.12 and set for removal in 3.14.
* https://github.com/python/cpython/issues/93370
* https://github.com/python/cpython/pull/93482
<!-- gh-linked-prs -->
### Linked PRs
* gh-118925
<!-- /gh-linked-prs -->
| a0193479475a047b223f64130867a63b672c8dc2 | b309c8ebff011f27012367b046ff92eecbdd68a5 |
python/cpython | python__cpython-118923 | # Make `frame.f_locals.copy()` return a snapshot dict of `f_locals`
# Feature or enhancement
### Proposal:
Per PEP 667, `frame.f_locals` is now a write-through proxy (`FrameLocalsProxy`) for underlying fast local variables. In the beginning we did not implement the `copy()` method because we think `dict(frame.f_loca... | 35c436186b849f8f2f9fb866c59015c9d034d448 | b88889e9ffd7b2d2bdac75aecbf14e37fd68e337 |
python/cpython | python__cpython-119232 | # Inappropriateness in unittest documentation with actual behavior
# Documentation
https://docs.python.org/3/library/unittest.mock.html#auto-speccing
https://github.com/python/cpython/blob/c444362c6e0b6c01f49c3bee864100f52bd3b640/Doc/library/unittest.mock.rst#L2615
```python
mock = Mock(name='Thing', return_valu... | 7e57640c7ec6b7b5ce9b5eac465f6b771fd6ae69 | a443e542811cd8242d6f42e817b0f0af0dd2fd92 |
python/cpython | python__cpython-119355 | # Editing the last line in a block in the new REPL is buggy
# Bug report
### Bug description:
When editing the last line in a function in the new REPL, hitting Enter doesn't end the block if the last line has indentation on it.
 contains lots of boilerplate for handling contradictions and running out of space in the optimizer's data structures.
These can be handled but setting flags on the optimizer context and checki... | f5c6b9977a561fcf9c2a803fb08652fd39b13d3b | 941eea0a27de6e5c02d3c80924235a7a07bd095a |
python/cpython | python__cpython-118902 | # `NotImplemented` is never tested with attribute assignment
# Bug report
This issue adds tests for `NoDefault` and attribute assignment: https://github.com/python/cpython/issues/118895
But, we never had tests for the same thing of `NotImplemented`. I will add a test case for that.
<!-- gh-linked-prs -->
### Linked... | ec1398e117fb142cc830495503dbdbb1ddafe941 | 5b941e57c71d7d0ab983d81a169f892662cfe446 |
python/cpython | python__cpython-118897 | # Assigning attributes to `typing.NoDefault` raises `TypeError`, but should raise `AttributeError`
# Bug report
### Bug description:
Most sentinels in Python raise `AttributeError` if you try to assign attributes to them, but `typing.NoDefault` raises `TypeError` instead. I think this should be `AttributeError`, for... | 13d7cf997bc9c22cf67c42fd799413e8325e0039 | c444362c6e0b6c01f49c3bee864100f52bd3b640 |
python/cpython | python__cpython-119433 | # Add support for new REPL in `python -m asyncio`
# Feature or enhancement
They are different now:

Hm, right now I don't see any simple way of merging these two together:
https://github.com/python/cpython/blob/c68a... | 2237946af0981c46dc7d3886477e425ccfb37f28 | f9d47fed9fbbe9313404838050f6dfe1c7fe6340 |
python/cpython | python__cpython-119318 | # "Paste mode" in the new REPL does not display the result of evaluated expressions
We've discovered that if you manually type out a condition that evaluates to `False` in the new REPL, `False` is printed as the result, as expected...
```pycon
>>> (3, 13, 0, "final") < (3, 13, 0, "beta")
False
```
...but that... | a3e4fec8734a304d654e4ae24a4aa2f41a7b0640 | 9fa206aaeccc979a4bd03852ba38c045294a3d6f |
python/cpython | python__cpython-119893 | # Python 3.13.0b1: exec() does not populate locals()
# Bug report
### Bug description:
### x.py
```python
xxx = 118888
```
### readx.py
```python
def f():
with open("x.py", encoding="utf-8") as f:
exec(compile(f.read(), "x.py", "exec"))
return locals()["xxx"]
print(f())
```
... | 2180991ea3d50f56595edae241cc92dd4e7de642 | 3859e09e3d92d004978dd838f0511364e7edfb94 |
python/cpython | python__cpython-118939 | # Tab completion behaviour in new REPL
# Bug report
### Bug description:
I've been playing a bit with the new REPL, it's so awesome! (thanks to @pablogsal and @ambv for the core.py episode :love_letter: )
I noticed a strange behaviour of the tab completion, whereas upon pressing the tab twice to show availabl... | 29caec62ee0650493c83c778ee2ea50b0501bc41 | 5a9afe23620aadea30013076d64686be8bf66f7e |
python/cpython | python__cpython-118936 | # `AssertionError` occurs using 3.130b1 interactive mode when pressed tab and up arrow
# Bug report
### Bug description:
Hi dear core developers,
I was playing with the newest REPL v3.130b1 on my M2 MacBook Pro with macOS 14.3. I built the python binary from the source at commit `b62cb5234b`. It's really impressive... | c0d81b256604a1079349d82d136db43eefcb3df1 | 7e1a130b8ff1ed8b3a5f00fe0f06d3916b852216 |
python/cpython | python__cpython-118880 | # "AttributeError: 'NoneType' object has no attribute 'is_absolute' " occurs when building 3.13.0 beta 1 from source on Windows
# Bug report
### Bug description:
The above error occurs when building python 3.13 beta 1 from source on Windows. Have determined that ns.temp not being defined before its is_absolute()... | d8a82cca12e12a6b22bfe6691e9b222f6d276f0a | b4ca389281849e849fb58fecf9b31e2e2f5a39c1 |
python/cpython | python__cpython-118869 | # kwargs are no longer passed to logging QueueHandler in 3.12
# Bug report
### Bug description:
kwargs are no longer passed to logging QueueHandler in 3.12
```python
import logging
import logging.config
import logging.handlers
import queue
class TestQueueHandler(logging.handlers.QueueHandler):
def __init__(... | dce14bb2dce7887df40ae5c13b0d13e0dafceff7 | 9e052619a6d32051394444c24d3185db1735a893 |
python/cpython | python__cpython-118854 | # Default expr_context parameters in ast to Load()
# Feature or enhancement
### Proposal:
In #105858, we changed the AST node constructors to raise a DeprecationWarning when any required fields are omitted. Optional fields default to None and list fields default to an empty list. In real-world usage, it emerges that... | 68fbc00dc870f6a8dcbecd2ec19298e21015867f | 98ff3f65c0232f31df89ebb52b244625ec9e3eb6 |
python/cpython | python__cpython-118850 | # code will never be executed warning in `dictobject.c`
# Bug report
Here's how this code looks right now:
https://github.com/python/cpython/blob/c3643a121401d111bebd3e26d6f362ade2ed2a83/Objects/dictobject.c#L5489-L5500
```
gcc -c -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -I/Libra... | 82abe75e77129bebb3c13d807e8040f6924194f6 | 8af84b503d0b62a3db0d806d39f42c1e08746079 |
python/cpython | python__cpython-118862 | # Freethreading build fails -m test --pgo: test_ordered_dict and test_struct failed
# Bug report
### Bug description:
When we build Python 3.13.0b1 in Fedora with `--disable-gil --enable-optimizations`, the PGO task fails. I was able to reproduce this from the 3.13 branch by:
```
$ ./configure --config-cache... | 1b1db2fd9a531e26b79b34667bccfb938c4d184d | 71cc0651e79041abd648595f3030dfa41009137a |
python/cpython | python__cpython-118935 | # --disable-gil & --enable-experimental-jit fails to build on M1 Mac
# Bug report
### Bug description:
On my M1 Mac, if I configure like so: `./configure --disable-gil --enable-experimental-jit` I get a compilation error:
```
gcc -c -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -D_... | 5b941e57c71d7d0ab983d81a169f892662cfe446 | abead548af0172dabba13da8bacf2da3c02d4927 |
python/cpython | python__cpython-119000 | # `--enable-experimental-jit` fails to build: `AssertionError: SHT_NOTE` in 3.13.0b1
# Bug report
### Bug description:
When trying to build CPython with `--enable-experimental-jit` against LLVM 18.1.5, I'm getting the following error:
```pytb
$ make
python3.13 ./Tools/jit/build.py x86_64-pc-linux-gnu
=============... | e04cd964eb4eee1b0ae5b2c34727abce6c0fb7f0 | fc757925944a9486d4244853dbe6e37ab3e560c2 |
python/cpython | python__cpython-119942 | # IndexError on REPL startup in _pyrepl/reader.py with Python 3.13.0b1+ and a custom sys.ps1 set in a PYTHONSTARTUP file
# Bug report
### Bug description:
I compiled Python 3.13 (commit d86b494117, the current tip of the 3.13 branch), and installed it into ~/opt/python313. When I run `python3.13` with no argum... | 2e0aa731aebb8ef3d89ada82f5d39b1bbac65d1f | 4e8aa32245e2d72bf558b711ccdbcee594347615 |
python/cpython | python__cpython-119340 | # Bump pickle.DEFAULT_PROTOCOL to 5 in 3.14
Opening so we don't forget. I'll get to it later if no one beats me to it.
<!-- gh-linked-prs -->
### Linked PRs
* gh-119340
<!-- /gh-linked-prs -->
| d66b06107b0104af513f664d9a5763216639018b | a1df1b44394784721239615f307b273455536d14 |
python/cpython | python__cpython-118828 | # Remove deprecated `Quoter` from `urllib.parse`
# Feature or enhancement
It was deprecated in 3.11 https://github.com/python/cpython/commit/d597fdc5fd0e8aa73a783fea27287db669950c15
<!-- gh-linked-prs -->
### Linked PRs
* gh-118828
<!-- /gh-linked-prs -->
| 84c3191954b40e090db15da49a59fcc40afe34fd | 52586f930f62bd80374f0f240a4ecce0c0238174 |
python/cpython | python__cpython-118826 | # Remove deprecated `master_open` and `slave_open` from `pty`
# Feature or enhancement
They were deprecated in https://github.com/python/cpython/issues/85984 and https://github.com/python/cpython/commit/244d4cd9d22d73fb3c0938937c4f435bd68f32d4
<!-- gh-linked-prs -->
### Linked PRs
* gh-118826
<!-- /gh-linked-prs -->... | f912e5a2f6d128b17f85229b722422e4a2478e23 | b407ad38fb93585332c370b8fa56905fb238cdfd |
python/cpython | python__cpython-118848 | # Zero-valued flag enum has no name
# Documentation
Quoting `Doc/howto/enum.rst:1148`:
```rst
- names of pseudo-flags are constructed from their members' names::
>>> (Color.RED | Color.GREEN).name
'RED|GREEN'
```
This section was originally added in 7aaeb2a3.
If you have a zero-valued flag, and y... | ed5ae6c4d76feaff06c2104c8ff864553b000253 | 753ef8db97ccb755d3c6fe089e883fe7ed5eb0d8 |
python/cpython | python__cpython-118819 | # ``asyncio REPL`` is not working on Windows
# Bug report
### Bug description:
Running the asyncio REPL with Python 3.13b1 on Windows gives
```python
>py -3.13 -m asyncio
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
F... | c3643a121401d111bebd3e26d6f362ade2ed2a83 | 35b5eaa176a5bae8a0cacb9c9f40ec948ecc4325 |
python/cpython | python__cpython-118806 | # Remove `type`, `choices`, and `metavar` parameters of `argparse.BooleanOptionalAction`
# Feature or enhancement
Original issue: https://github.com/python/cpython/issues/92248
I will send a PR.
<!-- gh-linked-prs -->
### Linked PRs
* gh-118806
<!-- /gh-linked-prs -->
| da090f1658e72485b201507653f6d673f3e39c86 | c68acb1384a51eb745f572687eaf677371b9e765 |
python/cpython | python__cpython-118831 | # ``test_os`` fails on Windows
# Bug report
### Bug description:
<details>
```python
./python.bat -m test -v test_os
Running Debug|x64 interpreter...
== CPython 3.14.0a0 (heads/bump_lib_version-dirty:a8d31d432c, May 8 2024, 23:21:14) [MSC v.1933 64 bit (AMD64)]
== Windows-10-10.0.19043-SP0 little-... | 82acc5f2113bffd0ed902851f4ccf5b9be8980b2 | 7c87ce777b3fd9055b118a58ec8614901ecb45e9 |
python/cpython | python__cpython-118799 | # Remove isdst parameter from `email.utils.localtime`
It was deprecated in 3.12 and set for removal in 3.14.
* https://github.com/python/cpython/issues/72346
* https://github.com/python/cpython/pull/91450
<!-- gh-linked-prs -->
### Linked PRs
* gh-118799
* gh-118940
<!-- /gh-linked-prs -->
| c68acb1384a51eb745f572687eaf677371b9e765 | fa9b9cb11379806843ae03b1e4ad4ccd95a63c02 |
python/cpython | python__cpython-118797 | # `_PyWeakref_ClearRef` and `_PyWeakref_ClearWeakRefsExceptCallbacks` should be exposed in 3.13
`_PyWeakref_ClearRef` was previously [exposed](https://github.com/python/cpython/blob/656491783d2be0fe36feef5085a2406a05abbd66/Include/cpython/weakrefobject.h#L37) in the public C-API. In 3.13, it was moved to `pycore_weakr... | db5af7da092409030c9fbe0a3a986bd0ee441b8b | a895756aec688c049a983199e2d7fb801d6502c8 |
python/cpython | python__cpython-118800 | # tempfile.mkdtemp and pip fail on non-English Windows with 3.13.0b1
# Bug report
### Bug description:
```python
./python -m test -j 8
Running Debug|x64 interpreter...
== CPython 3.14.0a0 (heads/bump_lib_version:a8d31d432c, May 8 2024, 18:48:28) [MSC v.1933 64 bit (AMD64)]
== Windows-10-10.0.19043-SP0 little-endian
... | 8af84b503d0b62a3db0d806d39f42c1e08746079 | c30d8e5d6c6b657817d6b342f1021676d04dd5af |
python/cpython | python__cpython-118774 | # Relax TypeVar default ordering constraints
# Bug report
### Bug description:
```pycon
% ./python.exe
Python 3.14.0a0 (heads/main-dirty:891fd12e52, May 8 2024, 09:02:37) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> fr... | aac6b019fe91e2f9f7a955d4fc4db5d5efd968c9 | 6d419db10c84cacbb3862e2adc940342175bfce9 |
python/cpython | python__cpython-118825 | # 3.13 adds C macros/functions/types without the `Py`/`_Py` prefix
3.13 newly defines the following unprefixed functions/macros/types via `Python.h`. They should probably be hidden:
- [x] `uop_get_target` in `Include/cpython/optimizer.h:67`
- [x] `uop_get_exit_index` in `Include/cpython/optimizer.h:73`
- [x] `uop... | 941eea0a27de6e5c02d3c80924235a7a07bd095a | f772d0d08af2beef53db1e076c864cbdf3f5bac9 |
python/cpython | python__cpython-118775 | # Make `bool(NotImplemented)` into an error
See https://discuss.python.org/t/should-bool-notimplemented-become-an-error/51342 and #79893.
<!-- gh-linked-prs -->
### Linked PRs
* gh-118775
* gh-118813
<!-- /gh-linked-prs -->
| 3c079a020369173745a16ed4ef19a64f69e8592b | aac6b019fe91e2f9f7a955d4fc4db5d5efd968c9 |
python/cpython | python__cpython-118782 | # Tkinter getint(), getboolean() argument must be str, not tuple
# Bug report
Discovered during 3.13b1 release (we decided not to block the release over it, so this is just a known issue in b1):
While interacting with the config dialog in IDLE, I get these errors printed in the background.
```pytb
Exception ... | 5b88d95cc542cf02303c6fe0e8719a93544decdb | 7d722b7d3ac78bfa74a5d2f21513ffbf4f85cff2 |
python/cpython | python__cpython-118751 | # Asymptotically faster `int(string)`
### Proposal:
EDIT: I made better progress on this than I expected, reducing the cutoff dramatically to about 3.4 million digits, by revisiting and improving the "cached reciprocal approximation" approach. Still not really compelling, but ... what the heck :wink:.
Way back w... | ecd8664f11298a1a4f7428363c55ad2904c9f279 | caf6064a1bc15ac344afd78b780188e60b9c628e |
python/cpython | python__cpython-118748 | # Segfault accessing frame_locals
# Bug report
### Bug description:
I don't know how to cause this otherwise, but I can reproducibly trigger this segfault running:
```
python -m pytest "sklearn/tests/test_common.py::test_estimators[NuSVC()-check_classifiers_one_label_sample_weights]"
goldbaum at Nathans-MBP in ~/D... | e7aec8713f84e90b20c9baae6b7a91d87f327ff0 | 2f0a338be66e276a700f86af51d5ef54a138cbfb |
python/cpython | python__cpython-118735 | # "invalid integer constant expression" compiling pylifecycle.c
Looks like the logic for enabling the JIT cannot handle the variable being omitted entirely. Builds that don't use the build.bat script directly will fail.
<!-- gh-linked-prs -->
### Linked PRs
* gh-118735
<!-- /gh-linked-prs -->
| 460546529b0959ce9528dec1c5cd836dcc04ad2c | f5488550614858fdc7b442076fe73bdfa3cdd738 |
python/cpython | python__cpython-118732 | # "thread sanitizer" (tsan) CI job is hanging
# Bug report
### Bug description:
At least since yesterday, the "tsan" CI jobs (`Thread sanitizer (free threading) / Thread sanitizer`) have been regularly hanging on test_importlib. When that happens, the job must be cancelled and restarted, sometimes multiple times.
... | 2c19987db525f61e85dadb40b368c97254adc7cc | f58833ebf8161aaa33844d63fb51b1575180cfbb |
python/cpython | python__cpython-118745 | # Crash in `PyThreadState_DeleteCurrent`: drop_gil: GIL is not locked (free-threading)
# Crash report
https://github.com/python/cpython/blob/b9caa0977c512a5e7966ebfdc64fabdc4f3e4971/Python/ceval_gil.c#L232-L239
Found by running `./python Lib/test/test_importlib/partial/pool_in_threads.py`
```
#0 __pthread_k... | be1dfccdf2c5c7671b8a549e969b8cf7d60d9936 | b30d30c747df2bf9f1614df8e76db2ffdb24fcd8 |
python/cpython | python__cpython-118725 | # Change in `pdb` behavior at exit from post-mortem debugger
# Bug report
### Bug description:
In 3.12 and earlier, if user enters `quit`/`exit` commands or does Ctrl-D, `pdb` restarts script with corresponding message and exits only on repeated `quit`/`exit`/Ctrl-D:
```
$ python -m pdb -c c pdb_bug.py
Traceback (m... | e245ed7d1e23b5c8bc0d568bd1a2f06ae92d631a | f8373db153920b890c2e2dd8def249e8df63bcc6 |
python/cpython | python__cpython-120698 | # Make `IPv{4,6}Address.version` and `max_prefixlen` available on classes, not just instances
# Feature or enhancement
### Proposal:
Sometimes, when there is a function that can operate both on IPv4 and IPv6 addresses, it is convenient to pass it the corresponding type object (either `IPv4Address` or `IPv6Address`) ... | c530ce1e9d336b81c053a5985444b4553fdd7050 | 2daed5f7a7087c63f47c57554ff55ee947e7a53d |
python/cpython | python__cpython-118703 | # Implement vectorcall for BaseException to optimize creation of exception instances
Currently, creating an instance of an built-in exception uses the old METH_VARARGS calling convention which creates a temporary tuple to pass positional arguments.
I propose to implement vectorcall for BaseException.
<!-- gh-linke... | aa36f83c1670f1e41fa9432a20e5c4a88ee9012c | ec9d12be9648ee60a2eb02d67069d74f8b314df9 |
python/cpython | python__cpython-119216 | # Avoid creating a StopIteration instance for monitoring
# Feature or enhancement
### Proposal:
A new C-API for injecting monitoring events was discussed in https://github.com/python/cpython/issues/111997 and implemented for Py3.13 in https://github.com/python/cpython/pull/116413
A remaining issue is that signallin... | 6e9863d7a3516cc76d6ce13923b15620499f3855 | b64182550f73e556344bd754d32e3be5d22a74e1 |
python/cpython | python__cpython-118690 | # ePub error reported at docs@python.org
“error on line 80 at column 12: error parsing attribute name”
https://mail.python.org/archives/list/docs@python.org/thread/7DW6GALZLNNPBD2NWDJKIUKB6GVUEGYK/
<!-- gh-linked-prs -->
### Linked PRs
* gh-118690
* gh-118889
* gh-118890
<!-- /gh-linked-prs -->
| 7ac933e2609b2ef9b08ccf9c815b682b0e1ede2a | 7cc5e81a8259fb2e78ed12cbb15ad9e1710f20ed |
python/cpython | python__cpython-118709 | # REPL: Ctrl-R and arrow key trips assertion
# Bug report
Seen in `main` / b4bdf83cc67434235d9630c92c84a5261992b235 on Linux
1. Open the Python REPL
2. Press Ctrl-R to pull up the `(r-search )` prompt
3. Press any arrow key
```python
(r-search `') Traceback (most recent call last):
File "<frozen runpy>", line 198... | e5413ec7831608f6cb4f39d805785cb1d7b67702 | 71080b8a0fe5da46fb97659060db76fd95a3fb61 |
python/cpython | python__cpython-118730 | # Dead link for `linspace` recipe
# Documentation
https://github.com/python/cpython/blob/00d913c6718aa365027c6dcf850e8f40731e54fc/Doc/library/stdtypes.rst?plain=1#L1497-L1501
The "See also" section for `range` seems to have a dead link to the linspace recipe: https://code.activestate.com/recipes/579000/
<!-- ... | c4f9823be277b2e3de2315526612276626217743 | fcf52d7ceea3532f0b3475aadd4e1f72db463a1f |
python/cpython | python__cpython-118681 | # Add additional optional type parameter to `typing.ContextManager` and `typing.AbstractContextManager`
# Feature or enhancement
### Proposal:
As part of https://github.com/python/typeshed/pull/11048 `contextlib.AbstractContextManager` and `contextlib.AbstractAsyncContextManager` received an additional optional type... | 71080b8a0fe5da46fb97659060db76fd95a3fb61 | a855f824a2f5a310ffa58a973a8fe9feaa2500b3 |
python/cpython | python__cpython-118669 | # Inconsistent return types between SSLSocket and SSLObject certificate chain APIs
# Bug report
### Bug description:
The `get_verified_chain()` and `get_unverified_chain()` APIs for `SSLSocket` were updated in https://github.com/python/cpython/pull/109113, but the API wasn't updated for `SSLObject`. This leads to in... | 8ef358dae1959e2aff8b04fb69b8a36d6da6847a | c13e7d98fb8581014a225b900b1b88ccbfc28097 |
python/cpython | python__cpython-118651 | # Enum _sunder_ exclusion is overly strict
# Bug report
### Bug description:
Enums' exclusive access to \_sunder_ members inhibits their use with the IPython/Jupyter pattern of making HTML and other visual reprs available:
```python
from enum import Enum
class MyEnum(Enum):
A = 1
def _repr_html_(self):
... | 1e428426c836b9a434810a6b99f70454d3a9611e | 6cf70678e2d4126ed921e6288477ebd6889b9af7 |
python/cpython | python__cpython-118648 | # Add TypeVar defaults for Generator and AsyncGenerator
Now that PEP 696 has landed, we should add defaults to the Generator and AsyncGenerator types for the send and return types.
cc @Gobot1234 @Daverball (https://github.com/python/typeshed/pull/11867#issuecomment-2095879825)
<!-- gh-linked-prs -->
### Linked PRs... | 8419f01673858d5002747c9393d4ed0ec22fdb47 | 9fd33af5ac57f649971ffd8091bd898a96f85b55 |
python/cpython | python__cpython-119099 | # Error parsing email headers: AttributeError: 'ValueTerminal' object has no attribute 'fold'
# Bug report
### Bug description:
The following code breaks with an attribute error:
```python
import email.parser
import email.policy
a = 't'*46
h = f'''\
To: =?utf-8?B?dGVzdC50ZXN0LnRlc3QudGVzdEB0ZXN0LmNvbeKAiw=?= <tes... | 858b9e85fcdd495947c9e892ce6e3734652c48f2 | aee8f03abbebfb76357f459dfb297026862e3c0b |
python/cpython | python__cpython-118437 | # add warning for eval and exec (unsafe usage may lead to critical vulnerabilities)
# Documentation
Currently there are no warnings regarding the unsafe usage of `eval` and `exec`. If arbitrary user-supplied input is passed to them, this may pose a big security risk.
Relevant PR:
https://github.com/python/cpy... | 00e5ec0d35193c1665e5c0cfe5ef82eed270d0f4 | d4b6d84cc84029b598fc24b2d0cea543ee63bf84 |
python/cpython | python__cpython-118665 | # Remove new pyrepl "warning" on Windows
# Bug report
Whenever I start the REPL on Windows, it now prints a new statement: "warning: can't use pyrepl: No module named 'readline'" and as things now, it will continue to do so indefinitely. This is obnoxious. This is not a warning, not something I can or should do a... | 9bf00322ba09e2439a78fcec77dc6917e1391e31 | 67ce820d51d7f4bb7068ed560f4f2e2d83dd30d5 |
python/cpython | python__cpython-118614 | # Missing error handling in `_PyEval_GetFrameLocals` in `ceval.c`
# Bug report
Here's the problematic code: https://github.com/python/cpython/blob/d8d94911e2393bd30ca58a32b33d792307fdc00d/Python/ceval.c#L2497-L2504
What's wrong?
1. `PyDict_New()` can return `NULL`, it is not checked
2. `Py_DECREF(locals);` is only c... | a8e5fed1007233f677d3539162257b99b920df00 | 1506d5adc457a806e85886018804483e808d85c5 |
python/cpython | python__cpython-118611 | # Centralize power caching in `_pylong.py`
### Proposal:
A number of functions in `_pylong.py` craft their own schemes to cache costly `**` results. This complicates their code, and all of them end up doing more work than necessary.
So I want to add a new internal `compute_powers()` function that computes all and ... | 2f0a338be66e276a700f86af51d5ef54a138cbfb | 2a85bed89dc14327afe344a57233a37795fde2b9 |
python/cpython | python__cpython-118615 | # ``Objects/frameobject.c`` lacks error-checking
# Bug report
### Bug description:
There's a couple of moments like this:
https://github.com/python/cpython/blob/d8d94911e2393bd30ca58a32b33d792307fdc00d/Objects/frameobject.c#L323-L327
Of course, we need to add a check that ``dct`` has a non-NULL value.
How... | 7528b84e947f727734bd802356e380673553387d | 709ca90a00e66cea432096a7ba61aa6459d2a9a7 |
python/cpython | python__cpython-118607 | # ``test_bdb`` leaks references
# Bug report
### Bug description:
```python
./python -m test -R 3:3 test_bdb
Using random seed: 2592309756
0:00:00 load avg: 25.13 Run 1 test sequentially
0:00:00 load avg: 25.13 [1/1] test_bdb
beginning 6 repetitions. Showing number of leaks (. for 0 or less, X for 10 or more)
123:4... | b4f8eb0de2c775e4fb11b15d26b9f21195732d47 | d8d94911e2393bd30ca58a32b33d792307fdc00d |
python/cpython | python__cpython-118597 | # Add thread-safety clarifications to the SSLContext documentation
# Documentation
Currently there is no documentation that tells anything about whether `SSLContext` is thread-safe or not and how it can be shared between different connections. Knowing how to share the `SSLContext` between different threads and conn... | 4f59f8638267aa64ad2daa0111d8b7fdc2499834 | 92cebaa4911786683e87841bf7788351e7595ac2 |
python/cpython | python__cpython-119936 | # inspect.signature.BoundArguments "POSITIONAL_OR_KEYWORD" Arguments are always args
# Feature Request
### Feature description:
```python
from inspect import signature
def foo(bar, /, baz, *, bat):
...
ba = signature(foo).bind('bla', baz='bli', bat='blub')
```
In this case the argument `baz` get re... | 8e99495701737c9d9706622f59581213ef163b23 | f5597dbd0e7938648bfd9244f4a9225825b36b2b |
python/cpython | python__cpython-118570 | # How to dynamically create PEP695 classes? Let's add a test for it
# Feature or enhancement
Right now we don't have a single test to dynamically create a PEP-695 class.
It is quite complex, because, for example, it cannot be done via `type()`, you have to use `types.new_class`. Example:
```python
import typing
T =... | 5f547585fa56c94c5d836b5313a7200f4937ebc4 | f34e965e52b9bdf157b829371870edfde45b80bf |
python/cpython | python__cpython-118723 | # `test_free_threading.test_racing_iter_extend` crash
# Crash report
Seen in one of @swtaarrs's PRs:
```
test_racing_iter_extend (test.test_free_threading.test_list.TestList.test_racing_iter_extend) ... Fatal Python error: Segmentation fault
```
https://github.com/python/cpython/actions/runs/8942881107/job/24566423... | 2402715e10d00ef60fad2948d8461559d084eb36 | 82abe75e77129bebb3c13d807e8040f6924194f6 |
python/cpython | python__cpython-118553 | # drop_gil in ceval_gil.c checks locked using _Py_atomic_load_ptr_relaxed instead of _Py_atomic_load_int_relaxed
# Bug report
### Bug description:
In `drop_gil()` in ceval_gil.c, there's a check to see if `gil->locked`, but it's loaded using `_Py_atomic_load_ptr_relaxed` instead of `_Py_atomic_load_int_relaxed`. Thi... | 0e78a545e6e78b16eb7709ec3db2243364603134 | 6d9e8e989e9e0931f84155451f921621b906e213 |
python/cpython | python__cpython-118528 | # Scaling bottlenecks in the free-threaded build
There are a few remaining scaling bottlenecks in the free-threaded build that we should fix.
I have been using the following benchmark to detect bottlenecks that were previously issues in older versions of the nogil forks:
https://gist.github.com/colesbury/429fe9f90... | 24e643d4ef024a3561c927dc07c59c435bb27bcc | c8deb1e4b495bf97ab00c710dfd63f227e1fb645 |
python/cpython | python__cpython-118520 | # The check to see if we have no weakrefs isn't correct
# Bug report
### Bug description:
https://github.com/python/cpython/blob/main/Objects/weakrefobject.c#L991
This is checking if we have a list at all, rather than if the list is empty. This is causing a slow down that's pretty significant on free-threaded buil... | e54b0c8a4ad6c6e958245eb3ea4ecc47e0f97ff0 | 1e67b9207c31a92d76bfac09fc706c4dc703669e |
python/cpython | python__cpython-112254 | # Allow perf to work without frame pointers
<!-- gh-linked-prs -->
### Linked PRs
* gh-112254
* gh-118592
* gh-118640
* gh-118646
* gh-118654
* gh-118693
* gh-118708
* gh-130866
* gh-131059
<!-- /gh-linked-prs -->
| 1b22d801b86ed314c4804b19a1fc4b13484e3cea | 999f0c512281995fb61a0d9eda075fd846e8c505 |
python/cpython | python__cpython-118526 | # UnboundLocalError when module is shadowed by a comprehension and then accessed by another comprehension
# Bug report
### Bug description:
Seems to be a regression in 3.12 when compared to 3.11, likely caused by [PEP 709: Comprehension inlining](https://docs.python.org/3.12/whatsnew/3.12.html#pep-709-comprehension-... | c8deb1e4b495bf97ab00c710dfd63f227e1fb645 | 37ccf167869d101c4021c435868b7f89ccda8148 |
python/cpython | python__cpython-119155 | # re docs should state exactly which whitespace is matched by \s
# Documentation
Currently, and since 3.0 it seems, it simply states that `\s` "Matches Unicode whitespace characters (which includes `[ \t\n\r\f\v]`, and also many other characters, for example the non-breaking spaces mandated by typography rules in m... | 22fdb8cf899d2dd29f2ac0bf61309af6809719fb | 23f159ae711d84177e8ce34cd9a6c8a762de64ac |
python/cpython | python__cpython-118755 | # Refactor `nt._path_is*` & `nt._path_[l]exists`
# Feature or enhancement
### Proposal:
Quoting @eryksun:
> I agree that all of these `_path_is*` and `_path_[l]exists` helpers are a lot of code to maintain, taken together. It could be refactored into smaller inline helper functions that can be reused, which w... | b64182550f73e556344bd754d32e3be5d22a74e1 | de8f530841b55885b919677a6938ab33d4a92f20 |
python/cpython | python__cpython-118501 | # Support zipapp on pdb
# Feature or enhancement
### Proposal:
zipapp is a format Python officially supports and it seems like pdb should just support debugging it. I don't see a reason why we would not want to do that. Also as all the pieces are already in there, it's not difficult to support it.
### Has this alre... | 4e2caf2aa046bf80e87e9b858837bb527459a034 | e54b0c8a4ad6c6e958245eb3ea4ecc47e0f97ff0 |
python/cpython | python__cpython-118530 | # Thread Sanitizer failure: `LLVMSymbolizer: error reading file: No such file or directory` in free-threaded TSan CI
See: https://github.com/python/cpython/actions/runs/8915487425/job/24485217543 and https://github.com/python/cpython/actions/runs/8915976859/job/24486582444?pr=118493
```
0:03:54 load avg: 3.29 [21/... | 3e818afb9b7c557aa633aeb3d5c4959750feeab0 | 2dae505e87e3815f087d4b07a71bb2c5cce22304 |
python/cpython | python__cpython-118537 | # Add linting job to `.pre-commit-config.yaml` for JIT files
Per discussion in https://github.com/python/cpython/pull/118481
<!-- gh-linked-prs -->
### Linked PRs
* gh-118537
<!-- /gh-linked-prs -->
| cb57a52a85a7845b1c017085f05a7f6d71855edc | dd8f05fee26cb98770744291a007ceb6b49a5089 |
python/cpython | python__cpython-118488 | # [CVE-2024-4030] Enable `mkdir(mode=0o700)` to work on Windows
If we interpret `0o700` as "only accessible by the current user", then we can imitate the behaviour with ACLs.
<!-- gh-linked-prs -->
### Linked PRs
* gh-118488
* gh-118515
* gh-118737
* gh-118738
* gh-118739
* gh-118740
* gh-118741
* gh-118742
* gh-1187... | 81939dad77001556c527485d31a2d0f4a759033e | b3372481b6cae5766330b041c4622c28cee2119f |
python/cpython | python__cpython-118474 | # sys.set_asyncgen_hooks with invalid firstiter may partially set finalizer
# Bug report
### Bug description:
```python
finalizer = lambda *a: None
try:
sys.set_asyncgen_hooks(firstiter="invalid", finalizer=finalizer)
except TypeError: # TypeError due to invalid `firstiter` type
... | 8d8275b0cf43f0e20c72a9641cbddc5044cdae04 | e272195b3eff3a78e334a601a637d198b8de2319 |
python/cpython | python__cpython-118456 | # mangle_from_ default in email.policy.Policy.__doc__ is wrong
# Bug report
### Bug description:
```
>>> from email.policy import Policy
>>> Policy.mangle_from_
False
>>> print(Policy.__doc__)
...
mangle_from_ -- a flag that, when True escapes From_ lines in the
body of the mess... | fed8d73fde779fca41026398376cb3038e9b2b5f | 711c80bfca5dd17cb7c6ec26f0e44848b33aec04 |
python/cpython | python__cpython-118489 | # `posixpath.realpath('secretlink')` raises
# Bug report
### Bug description:
GNU coreutils `realpath -m` doesn't raise an error for secret symlinks (no read permission):
```zsh
wannes@Stefans-iMac dirs % sudo ls -l secret-symlink
l--------- 1 wannes staff 44 Jun 30 2023 secret-symlink -> /Users/wannes/path-pic... | caf6064a1bc15ac344afd78b780188e60b9c628e | 30b4e9f9c42493136c58c56fee5553128bb32428 |
python/cpython | python__cpython-125467 | # Add `INSTRUCTION_SIZE` macro to code generator.
In bytecodes.c we use both `next_instr - this_instr` and `1 + INLINE_CACHE_ENTRIES_...` to mean "instruction length".
We should add a macro for the purpose that is understood by the code generator.
### Examples
The somewhat confusing `LOAD_IP(1 + INLINE_CACHE_EN... | aab58a93efd09185e3622572d2624a31e0fe405b | b2eaa75b176e07730215d76d8dce4d63fb493391 |
python/cpython | python__cpython-118429 | # test_run_fileexflags() crash on PPC64LE RHEL7 LTO + PGO 3.x
# Bug report
build: https://buildbot.python.org/all/#/builders/43/builds/5305/steps/5/logs/stdio
Logs:
```
./python -E -m test --slow-ci --timeout=1200 -j2 --junit-xml test-results.xml -j10
+ ./python -u -W default -bb -E -m test --slow-ci --timeout=12... | e93c39b47ea623dfaf61f80775ad4747b163efe5 | 587388ff22dc7cfa4b66722daf0d33cd804af9f2 |
python/cpython | python__cpython-118431 | # TypeError: _eval_type() missing 1 required positional argument: 'type_params' with import module
# Bug report
### What happened?
```python
import openai
```
```pytb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.12/site-packages/openai/__init__.p... | 4a5ad8469af9a6fc0ec1355eb203cc22bb4321d5 | 72dae53e09a5344bf4922d934a34a2fa48a11c86 |
python/cpython | python__cpython-118496 | # Assertion failure with multiple threads & legacy opcode tracing in free-threaded build
# Crash report
### What happened?
~~Bisected to 33da0e844c922b3dcded75fbb9b7be67cb013a17.~~
```python
import sys
import threading
def trace(frame, event, arg):
frame.f_trace_opcodes = True
return trace
sys... | 00d913c6718aa365027c6dcf850e8f40731e54fc | 9bf00322ba09e2439a78fcec77dc6917e1391e31 |
python/cpython | python__cpython-118683 | # Assertion failure in `_PyEval_EvalFrameDefault` with generators and `LINE`/`INSTRUCTION` event monitoring
# Crash report
### What happened?
Bisected to 3e06c7f719b99cc7f5e8889319cff4980e41d3e8, where given assertion was added.
Repro:
```python
from sys import monitoring as mon
mon.use_tool_id(mon.DEBUGGER_ID, "t... | 0d9148823dbb6af020945ab1b487d7f183b561a5 | b2cd54a4fb2ecdb7b1d30bda8af3314d3a32031e |
python/cpython | python__cpython-118491 | # `WithThreadsTestPool.test_release_task_refs`: flaky test or possible free-threading bug
This might be a free-threading related bug or possibly a flaky test. We should investigate and try to figure out the root cause.
```
======================================================================
FAIL: test_release_t... | c408c36e9b346f9f15a34e98a5596f311df65efa | a7711a2a4e5cf16b34fc284085da724a8c2c06dd |
python/cpython | python__cpython-118428 | # Implement inspect.signature() for sqlite3 connection object
# Feature or enhancement
`sqlite3.connection()` returns a custom callable object. But `inspect.signature()` returns a generic `<Signature (*args, **kwargs)>` for it:
```pycon
>>> import inspect, sqlite3
>>> con = sqlite3.connect(':memory:')
>>> con('selec... | b568c2c1ff5c0b1922a6402dc95c588d7f9aa914 | 19d468a3ab1d57c07a4283d67d439908574aa0cc |
python/cpython | python__cpython-118405 | # inspect.signature() raises TypeError for non-comparable callable
# Bug report
Example:
```py
class NoncomparableCallable:
def __call__(self, a):
pass
def __eq__(self, other):
1/0
import inspect
inspect.signature(NoncomparableCallable())
```
Real world example -- the result of `functools.cmp... | 11f8348d78c22f85694d7a424541b34d6054a8ee | 5b05d452cd20d9f0cfecdeec90adad3af5e4dfff |
python/cpython | python__cpython-118427 | # Implement inspect.signature() for functools.cmp_to_key() result
# Feature or enhancement
`functools.cmp_to_key()` returns a custom callable. `inspect.signature()` ~returns generic `<Signature (*args, **kwargs)>`~ raises a TypeError for the C implementation. The following PR makes it returning the same signature (... | 17a8af9508d6001e1666de984e2fb73f02167306 | 02887c6428042832f17fd71ed90619f25d8f951d |
python/cpython | python__cpython-118403 | # Doc workflow is failing due to a missing file 'Doc/sphinx-warnings.txt'
# Bug report
### Bug description:
Example: https://github.com/python/cpython/actions/runs/8883326110/job/24389960128?pr=118368
```pytb
Traceback (most recent call last):
File "/home/runner/work/cpython/cpython/Doc/tools/check-warnin... | ee3413c1c70725e133b29bb1d245f569a8f64062 | 529a160be6733e04d2a44051d3f42f6ada8c1015 |
python/cpython | python__cpython-118381 | # Don't use `Py_BuildValue("(OO...)", a, b, ...)`
# Feature or enhancement
### Proposal:
This is an inefficient way to build a tuple:
```c
Py_BuildValue("(OO)", a, b)
```
This is faster, and more readable:
```c
PyTuple_Pack(2, a, b)
```
And if #118222 lands, we could use this even faster variant for length 1 & 2... | 9a75d56d5d9fdffb6ce9d83ede98486df238102d | 17a8af9508d6001e1666de984e2fb73f02167306 |
python/cpython | python__cpython-118375 | # ``test_ast`` raises a ``DeprecationWarning``
# Bug report
### Bug description:
```python
./python.exe -m test -q test_ast
Using random seed: 2061872940
0:00:00 load avg: 4.08 Run 1 test sequentially
/Users/admin/Projects/cpython/Lib/test/test_ast.py:1356: DeprecationWarning: Name.__init__ missing 1 required positi... | aa8f6d2708bce1462544d2e2cae05a2595ffd9ec | 133c1a7cdb19dd9317e7607ecf8f4fd4fb5842f6 |
python/cpython | python__cpython-118454 | # Simple racing class attribute read-write crashes on free-threaded builds
# Crash report
### What happened?
The following segfaults:
```python
from multiprocessing.dummy import Pool
NTHREADS = 6
class A:
attr = 1
BOTTOM = 0
TOP = 1000
ITERS = 100
def read(id0):
for _ in range(ITERS):
for _ in r... | 5a1618a2c8c108b8c73aa9459b63f0dbd66b60f6 | e6b213ee3ffb05f067d30cb8bb45681887212444 |
python/cpython | python__cpython-118368 | # Broken `bdb.Bdb.user_call` API
# Bug report
### Bug description:
This is an issue with how `bdb.Bdb.user_call` is documented.
According to the [`bdb` documentation](https://docs.python.org/3/library/bdb.html#bdb.Bdb.user_call), `bdb.BdB.user_call` has two arguments, `frame` and `argument_list`.
This is implemente... | 8e4fb5d260e529c9d4ca60980225fbd00dd5c3c8 | 96d8ca7ad6c4f23f023dd6ed0abd042b29dff4a2 |
python/cpython | python__cpython-118354 | # ``test_capi`` surprisingly skipped on Windows
# Bug report
### Bug description:
```
>python -m test test_capi
Running Debug|x64 interpreter...
Using random seed: 1337652706
0:00:00 Run 1 test sequentially
0:00:00 [1/1] test_capi
test_capi skipped -- requires test module
test_capi skipped
== Tests result: SUCCESS ... | 51c70de998ead35674bf4b2b236e9ce8e89d17b4 | 44f57a952ea1c25699f19c6cf1fa47cd300e33aa |
python/cpython | python__cpython-118386 | # Python 3.12.3 installer fails to install py.exe
# Bug report
### Bug description:
I use Python with MkDocs and had needed to update my environment on a Windows 10 machine that only had Python 3.7. I installed version 3.12.3 since it is the latest stable at the time. I used all the default settings. Afterwards, ... | 96d8ca7ad6c4f23f023dd6ed0abd042b29dff4a2 | 2ba1aed596ff9e7c5e193cf990f1f20f08bbf116 |
python/cpython | python__cpython-118339 | # Configure Tier 2 interpreter at build time
It would be nice if by default we didn't ship the optimizer infrastructure, since approximately nobody is going to use it, so we should ship (and by default build) binaries that just don't include it.
I propose to enable it only when configured with `--enable-experimenta... | a524152b8c56f82d807ecdd7ae9d39cfd643c469 | 97feb4a78bf1ebdec26b685fd509cf57b3333e4a |
python/cpython | python__cpython-118412 | # Deadlock in `test_multiprocessing_pool_circular_import` in free-threaded build
# Bug report
I've observed an occasional deadlock involving the [warnings mutex](https://github.com/python/cpython/blob/5a90de0d4cbc151a6deea36a27eb81b192410e56/Include/internal/pycore_warnings.h#L17) in `test_multiprocessing_pool_circ... | b2c3b70c7102197e4505e6cd69722dc508527d22 | 4a1cf66c5c0afa36d7a51d5f9d3874cda10df79c |
python/cpython | python__cpython-118334 | # test_repl's test_no_memory: AssertionError: -6 not found in (1, 120)
# Bug report
### Bug description:
One of my PRs (https://github.com/python/cpython/pull/118283) started failing (https://github.com/python/cpython/actions/runs/8843882336?pr=118283) with this. Investigating, I can reproduce it locally on `main`, ... | 79688b5b0ea761183193ffb0859415f3b02fa44d | ee3413c1c70725e133b29bb1d245f569a8f64062 |
python/cpython | python__cpython-118324 | # Document `&&` eager parsing in `python.gram`
Right now it is not documented: https://github.com/python/cpython/blob/5a4d3df2fa02409ffd2a90cd75b67370206e9891/Grammar/python.gram#L45-L81
<!-- gh-linked-prs -->
### Linked PRs
* gh-118324
<!-- /gh-linked-prs -->
| 51aefc5bf907ddffaaf083ded0de773adcdf08c8 | c57326f48729f5cd7ddf7e2b38c4fd06d0962a41 |
python/cpython | python__cpython-118320 | # binascii.a2b_base64 strict mode accepts invalid base64 input
# Bug report
### Bug description:
```python
>>> import binascii
>>> f = lambda s: binascii.a2b_base64(s, strict_mode=True)
>>> f('AAAA')
b'\x00\x00\x00'
>>> f('AAAA=')
b'\x00\x00\x00'
>>> f('AAAA==')
b'\x00\x00\x00'
>>> f('AAAA===')
b'\x00\... | fe47d9bee319528ffeb5fd60a615d7f02c7b5585 | 3a6ff1b1d959549546f533b18ec71aa21516328d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.