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-119787 | # create an internals documentation folder in the cpython repo
The internals documentation is scattered in markdown files in the codebase, as well as parts which are in the dev guide. We would like to have it in one place, versioned along with the code (unlike the dev guide).
<!-- gh-linked-prs -->
### Linked PR... | e91fc11fafb657cab88c5e6f13822432a3b9dc64 | 6fb191be15fd49da10506de29b6393ffdf59b894 |
python/cpython | python__cpython-119781 | # Unexpected <class 'TypeError'> exception in test_format
# Bug report
### Bug description:
```
$ ./python -m test test_format
Using random seed: 982853282
0:00:00 load avg: 2.14 Run 1 test sequentially
0:00:00 load avg: 2.14 [1/1] test_format
Unexpected <class 'TypeError'> : '%c requires an integer in ra... | b278c723d79a238b14e99908e83f4b1b6a39ed3d | 010aaa32fb93c5033a698d7213469af02d76fef3 |
python/cpython | python__cpython-119785 | # Fix link in Python 3 porting
# Documentation
https://docs.python.org/3.12/howto/pyporting.html
`"You can find the old guide in the [archive](https://docs.python.org/3.12/howto/pyporting.html)."`
Link points to the page itself, not to the actual archive.
<!-- gh-linked-prs -->
### Linked PRs
* gh-119785... | 6fb191be15fd49da10506de29b6393ffdf59b894 | e50fac96e82d857ecc024b4cd4e012493b077064 |
python/cpython | python__cpython-119776 | # Remove deprecated feature to create immutable types with mutable bases
# Feature or enhancement
Refs https://github.com/python/cpython/pull/95533
Refs https://github.com/python/cpython/issues/95388
Now instead of a deprecation warning, we need to raise a `TypeError`.
I will send a PR.
<!-- gh-linked-prs -->
### ... | 4aed319a8eb63b205d6007c36713cacdbf1ce8a3 | fd6cd621e0cce6ba2e737103d2a62b5ade90f41f |
python/cpython | python__cpython-120256 | # _Py_c_pow() should adjust errno on error conditions
# Bug report
### Bug description:
Right now we do this after invocation of the function or it's optimized alternative (for small integers). That has advantage as - IIUC - both algorithms may trigger error condition. On another hand, behaviour of the public C AP... | 8a284e189673582e262744618f293f9901a32e49 | 81480e6edb34774d783d018d1f0e61ab5c3f0a9a |
python/cpython | python__cpython-119745 | # Move more functions from compile.c to flowgraph.c
Following #117494, there is now less coupling between compile.c and there are some functions that can move to, and belong better in, flowgraph.c. There include:
- stack effect functions
- _PyCompile_OptimizeCfg
- _PyCfg_FromInstructionSequence
<!-- gh-linked-pr... | 13a5fdc72f701c053b96abea48cd8f2775e9418e | 9732ed5ca94cd8fe9ca2fc7ba5a42dfa2b7791ea |
python/cpython | python__cpython-119743 | # Remove deprecated delegation of the int built-in to __trunc__.
Python 3.11 deprecated delegation of the `int()` built-in to `__trunc__` (see issue #89140). I haven't seen any evidence of problems arising from that deprecation, and I think it's now safe to remove that delegation for Python 3.14.
<!-- gh-linked-prs... | f79ffc879b919604ed5de22ece83825006cf9a17 | 4aed319a8eb63b205d6007c36713cacdbf1ce8a3 |
python/cpython | python__cpython-119738 | # `pkg-config` files (`.pc`) conflict between default and free-threaded build
# Bug report
If you install the default and free-threaded build to the same prefix, some files conflict and will get overwritten by the most recent install:
```
modified: bin/idle3.13
modified: bin/pydoc3.13
modified: bin/python3.... | 1c04c63ced5038e8f45a2aac7dc45f0815a4ddc5 | bf098d4157158e1e4b2ea78aba4ac82d72e24cff |
python/cpython | python__cpython-119728 | # Add `--single-process` option to regrtest to always run tests sequentially (ignore `-jN` option)
The Python release process runs tests sequentially. It catchs some issues which are ignored silently when running tests in parallel.
I propose adding `--sequentially` option to regrtest to always run tests sequentiall... | 4e8aa32245e2d72bf558b711ccdbcee594347615 | 1d4c2e4a877a48cdc8bcc9808d799b91c82b3757 |
python/cpython | python__cpython-119974 | # Syntax errors in `else` blocks are reported at `else`
Since #29513, syntax errors in `else` and `elif` blocks, like:
```python
if 1:
pass
else:
This is invalid syntax (sic)
```
are reported at the `else`:
```
File "/tmp/repro.py", line 3
else:
^^^^^^
SyntaxError: 'else' must match a val... | 31a4fb3c74a0284436343858803b54471e2dc9c7 | 105f22ea46ac16866e6df18ebae2a8ba422b7f45 |
python/cpython | python__cpython-119722 | # Integrate documentation fixes into `__about__` docstring of heapq module.
676d7aa905864157de630e5360291ccf7e6e997a and d2a296a73a3a49d15fd3d1505c10e98ab8ad1a63 made some corrections to `Doc/library/heapq.rst` that never got reflected in the `__about__` docstring in `Lib/heapq.py`.
<!-- gh-linked-prs -->
### Linked ... | 659cb7e6b8e83e1541fc27fd29d4846e940b600e | 78d697b7d5ec2a6fa046b0e1c34e804f49e750b4 |
python/cpython | python__cpython-136913 | # WinError 10022 for create_datagram_endpoint with local_addr=None.
# Bug report
### Bug description:
A problem occurs with the Windows proactor event loop when creating a datagram endpoint with `local_addr=None`. The problem does not occur with the selector event loop (either on Windows or Linux).
```python
impor... | 1481384141342479b3ba4b89f653b4e5bef0d272 | 45138d35843297395b2d646f5391be108243957a |
python/cpython | python__cpython-119705 | # ``test_pydoc`` leaks references
# Bug report
### Bug description:
```python
./python.exe -m test -R 3:3 test_pydoc
Using random seed: 928599674
0:00:00 load avg: 6.51 Run 1 test sequentially
0:00:00 load avg: 6.51 [1/1] test_pydoc.test_pydoc
beginning 6 repetitions. Showing numbe... | c0faade891e6ccb61137041fe10cc05e5fa8d534 | a8e35e8ebad8c3bb44d14968aa05d1acbc028247 |
python/cpython | python__cpython-119717 | # winapi audit events returning garbage
The CreateFile and CreateNamedPipe audit events from the winapi module appear to be returning garbage instead of the names. There's potential for buffer overreads and/or information leakage.
<!-- gh-linked-prs -->
### Linked PRs
* gh-119717
* gh-119732
* gh-119733
* gh-119734
*... | 78d697b7d5ec2a6fa046b0e1c34e804f49e750b4 | 34f9b3e7244615d2372614b20e10250e68cc8e61 |
python/cpython | python__cpython-119691 | # Generate stack effect for pseudo instructions
The opcode metadata has stack effect for real instructions, and then in code we add the pseudo instructions. Would be tidier to generate it for the pseudo instructions as well.
<!-- gh-linked-prs -->
### Linked PRs
* gh-119691
<!-- /gh-linked-prs -->
| c1e9647107c854439a9864b6ec4f6784aeb94ed5 | 7ca74a760a5d3cdf48159f003d4db7c2778e9261 |
python/cpython | python__cpython-119790 | # Windows installer missing free-threading library
# Bug report
### Bug description:
Tested with Python 3.13b1 release.
I've been trying to help someone test a simple extension module with the free-threading interpreter on Windows, which ultimately failed because it was missing `python313t.lib` so was unable to lin... | fd01271366abefa8f991e53f090387882fbd6bdd | 4765e1fa292007f8ddc59f33454b747312506a7a |
python/cpython | python__cpython-119677 | # LOAD_SUPER_METHOD etc don't need to be pseudo instructions
`LOAD_SUPER_METHOD`, `LOAD_ZERO_SUPER_METHOD`, `LOAD_ZERO_SUPER_ATTR`, `LOAD_METHOD` don't need to be pseudo-instructions. They are temporaries use solely within codegen.
<!-- gh-linked-prs -->
### Linked PRs
* gh-119677
<!-- /gh-linked-prs -->
| ae9140f32a1630838374f1af402291d4649a0be0 | 6b240c2308a044e38623900ccb8fa58c3549d4ae |
python/cpython | python__cpython-120295 | # Uninitialized value usage of localspluskinds in assemble.c's makecode function
# Bug report
### Bug description:
## Recreator
```bash
./python -c "class i:[super for()in d]*[__class__*4for()in d]"
<string>:1: SyntaxWarning: invalid decimal literal
[1] 23793 segmentation fault ./python -c "class i:[super for()... | 0ae8579b85f9b0cd3f287082ad6e194bdb025d88 | 34f5ae69fe9ab0f5b23311d5c396d0cbb5902913 |
python/cpython | python__cpython-119712 | # Build failure due to missing _Py_SINGLETON in static-extension-modules build (3.13 only)
# Bug report
### Bug description:
While attempting to upgrade [python-build-standalone](https://github.com/indygreg/python-build-standalone/pull/264) to support Python 3.13 beta releases, we've run into a build failure which m... | 7ca74a760a5d3cdf48159f003d4db7c2778e9261 | cd11ff12ac55f37d38b5ef08c143c78f07da5717 |
python/cpython | python__cpython-119660 | # Refactor: move `no_rerun` from `test_import` and `datetimetester` to `test.support`
# Feature or enhancement
It is defined here: https://github.com/python/cpython/blob/b407ad38fb93585332c370b8fa56905fb238cdfd/Lib/test/test_import/__init__.py#L123-L139
and here: https://github.com/python/cpython/blob/b407ad38fb9358... | 2da0dc094fa855ed4df251aab58b6f8a2b6969a1 | f912e5a2f6d128b17f85229b722422e4a2478e23 |
python/cpython | python__cpython-119713 | # test_datetime leaks references
Example:
```
$ ./python -m test -R 3:3 test_datetime -m test.datetimetester.TestDateTime_Pure.test_compat_unpickle
(...)
test_datetime leaked [8, 8, 8] references, sum=24
test_datetime leaked [8, 8, 8] memory blocks, sum=24
```
Regression: commit 3e8b60905e97a4fe89bb24180063... | 34f9b3e7244615d2372614b20e10250e68cc8e61 | 1f481fd3275dbc12a88c16129621de19ea20e4ca |
python/cpython | python__cpython-120909 | # Python IDLE stops outputting a string on encountering a null character both for STDOUT and STDERR
# Bug report
### Bug description:
I noticed that if you pass a string containing a null character (`\0`) as an argument to the built-in `print` function, IDLE only outputs that string to the point of the null characte... | c38e2f64d012929168dfef7363c9e48bd1a6c731 | fc297b4ba4c61febeb2d8f5d718f2955c6bbea0a |
python/cpython | python__cpython-119619 | # Deprecate Py_IS_NAN/INFINITY/FINITE?
# Feature or enhancement
### Proposal:
isnan(), isinf() and isfinite() are part of C99, which is a requirement for 3.11+. Probably, it does make sense to deprecate (undocumented) public macros and switch codebase to use C stdlib functions.
JFR: https://github.com/python... | cd11ff12ac55f37d38b5ef08c143c78f07da5717 | 86d1a1aa8841ea182eaf434ae6b942b3e93f58db |
python/cpython | python__cpython-132055 | # Failed to inspect `__new__` and `__init_subclass__` methods generated by `warnings.deprecated`
# Bug report
### Bug description:
[PEP 702 – Marking deprecations using the type system](https://peps.python.org/pep-0702) introduces a new API [`warnings.deprecated`](https://docs.python.org/3.13/library/warnings.ht... | b8633f9aca9b198e5592106b649389d638cbc620 | c14134020f44575635e11e4552cefcfd8cdbe22f |
python/cpython | python__cpython-119601 | # mock.patch introspects original even when new_callable set
# Bug report
### Bug description:
In order to patch `flask.g` e.g. as in #84982, that proxies getattr must not be invoked. For that, mock must not try to read from the original object. In some cases that is unavoidable, e.g. when doing `autospec`. However,... | 422c4fc855afd18bcc6415902ea1d85a50cb7ce1 | 6efe3460693c4f39de198a64cebeeee8b1d4e8b6 |
python/cpython | python__cpython-119593 | # Improve pow(fraction.Fraction(), b, modulo) error message
# Bug report
### Bug description:
`Fraction.__pow__` does not accept the third argument which `pow` tries to pass to it:
```
>>> pow(Fraction(1), 1, 1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Fraction._... | fcca08ec2f48f4ba5ba1d4690fb39b1efe630944 | bf4ff3ad2e362801e87c85fffd9e140b774cef26 |
python/cpython | python__cpython-119591 | # Implement zipfile.Path.is_symlink
In jaraco/zipp#117, I learned that the current implementation of `is_symlink` might have a security risk if a user is relying on it to ensure that a zipfile has no symlinks before using another tool to extract it.
zipp 3.19.0 adds an implementation for `Path.is_symlink` to allevi... | 42a34ddb0b63e638905b01e17a7254623a0de427 | fd01271366abefa8f991e53f090387882fbd6bdd |
python/cpython | python__cpython-119753 | # Crash in freethreading when acquiring/releasing the GIL in a finalizer
# Bug report
### Bug description:
bug.cpp
```c++
#include <thread>
#include <cstdio>
#include <latch>
#include <Python.h>
PyObject* callInDestructor(PyObject *self, PyObject *args) {
auto state = PyGILState_Ensure();
printf("In destru... | bcc1be39cb1d04ad9fc0bd1b9193d3972835a57c | 891c1e36f4e08da107443772a4eb50c72a83836d |
python/cpython | python__cpython-119623 | # ``test_import`` crashes with a ``--forever`` option
# Crash report
### Bug description:
```python
./python.exe -m test -v test_import -m test_check_state_first --forever
== CPython 3.14.0a0 (heads/main:5d04cc50e5, May 26 2024, 21:33:31) [Clang 15.0.0 (clang-1500.3.9.4)]
== macOS-14.5-arm64-arm-64bit-Mach-O little-... | ae7b17673f29efe17b416cbcfbf43b5b3ff5977c | 0bd0d4072a49df49a88e8b02c3258dbd294170f6 |
python/cpython | python__cpython-119582 | # The `dataclasses` unit tests should record behavior of shadowed init vars
# Tests should verify that dataclasses allow no-default `InitVars` to use shadowed names.
I was surprised, when reviewing a change to MyPy that allows `InitVar` fields to be shadowed by property methods, that this even works since the runti... | 6ec371223dff4da7719039e271f35a16a5b861c6 | 0518edc17049a2f474b049b7d7fe3ef4339ceb83 |
python/cpython | python__cpython-120006 | # Some environment variables are missing from `--help-env`
# Documentation
While looking for ways to control the new REPL, I found that `PYTHON_BASIC_REPL` influences it, but is not present in the output of `--help-env`.
Here's a list of environment variables that are present in [the documentation](https://docs.... | c81a5e6b5b7749862d271e7a67f89976069ad2cd | e9f4d80fa66e0d3331e79d539329747297e54ae5 |
python/cpython | python__cpython-119563 | # Remove AST nodes deprecated since Python 3.8, with warnings since Python 3.12
# Feature or enhancement
### Proposal:
In https://github.com/python/cpython/pull/104199, we added deprecation warnings for AST nodes that had been deprecated in the docs since Python 3.8. They have now had deprecation warnings for two re... | 008bc04dcb3b1fa6d7c11ed8050467dfad3090a9 | b5b7dc98c94100e992a5409d24bf035d88c7b2cd |
python/cpython | python__cpython-119561 | # Invalid Assert in PyState_FindModule()
# Crash report
### Bug description:
gh-118532 added an assert that is erroneously triggers if `PyState_FindModule()` is called before the provided module def has been initialized. The assert should be removed. (Python/import.c, line 460)
See https://github.com/ultrajson/ul... | ae7b17673f29efe17b416cbcfbf43b5b3ff5977c | 0bd0d4072a49df49a88e8b02c3258dbd294170f6 |
python/cpython | python__cpython-119557 | # New repl closes CLI session on SyntaxError inside of the match statement
# Bug report
### Bug description:
```pycon
>>> match 1:
... case {0: _, 0j: _}:
... pass
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _... | 86d1a1aa8841ea182eaf434ae6b942b3e93f58db | c0faade891e6ccb61137041fe10cc05e5fa8d534 |
python/cpython | python__cpython-119801 | # PyREPL: KeyboardInterrupt does not clear completion menu if it's already visible
# Bug report
### Bug description:
Pressing Ctrl-C (and emitting a KeyboardInterrupt) while the completion menu is visible (after having pressed Tab) does not clear it before the next line.
```python
>>> import itertools
itert... | 010ea93b2b888149561becefeee90826bf8a2934 | d419d468ff4aaf6bc673354d0ee41b273d09dd3f |
python/cpython | python__cpython-119549 | # Add a "clear" command to PYREPL
This will do the same as Ctrl+L as requested by @brandtbucher
<!-- gh-linked-prs -->
### Linked PRs
* gh-119549
* gh-119552
<!-- /gh-linked-prs -->
| e3bac04c37f6823cebc74d97feae0e0c25818b31 | a531fd7fdb45d13825cb0c38d97fd38246cf9634 |
python/cpython | python__cpython-119536 | # Support `pythonπ` in Python 3.14 venv's
# Feature or enhancement
### Proposal:
```
λ env/bin/pythonπ
Python 3.14.0a0 (heads/main-dirty:de19694cfb, May 24 2024, 23:13:56) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
```
<!-- gh-linked-prs -... | 54a6875adbc9091909b1473c49595c0cc84dc438 | 7eaa09739059aaac4812395f8d6bb586af8eadcc |
python/cpython | python__cpython-119527 | # Deadlock while updating type cache (free-threading)
# Bug report
Deadlock when running `pool_in_threads.py` (from `test_multiprocessing_pool_circular_import`)
This was observed with the GIL enabled (`PYTHON_GIL=1`) in the free-threaded build. I'm not sure if it could happen when the GIL is disabled.
The problem i... | c22323cd1c200ca1b22c47af95f67c4b2d661fe7 | df93f5d4bf9d70036d485666d4dd4f009d37f8b9 |
python/cpython | python__cpython-119680 | # `IncompleteInputError` is undocumented
#113745 added a new built-in exception `IncompleteInputError`, but it is not mentioned anywhere in the docs (except in the auto-generated list of classes) or in the What's New. It should be documented. cc @pablogsal
<!-- gh-linked-prs -->
### Linked PRs
* gh-119680
* gh-12094... | ac61d58db0753a3b37de21dbc6e86b38f2a93f1b | 65a12c559cbc13c2c5a4aa65c76310bd8d2051a7 |
python/cpython | python__cpython-123356 | # Stop manually interning strings in pathlib
When parsing and normalizing a path, pathlib calls `sys.intern()` on the string parts:
https://github.com/python/cpython/blob/96b392df303b2cfaea823afcb462c0b455704ce8/Lib/pathlib/_local.py#L273
I've never been able to establish that this is a worthwhile thing to do. T... | 5002f17794a9f403540305c733698d1e01699490 | 77a2fb4bf1a1b160d6ce105508288fc77f636943 |
python/cpython | python__cpython-119514 | # OOM vulnerability in the imaplib module
The IMAP4 protocol supports "literal" syntax, when one side specifies the size of the data and then sends the specified amount of bytes. The `imaplib` client reads such data with a single `read(size)` call, and therefore is affected by the general vulnerability in the `read()`... | 0fef47e5bbd167c21eb4f3cbd885cf61270014e7 | 43e024021392c8c70e5a56cdf7428ced45d73688 |
python/cpython | python__cpython-119507 | # `_io.TextIOWrapper.write`: write during flush causes `pending_bytes` length mismatch
# Crash report
### What happened?
Bisected to #24592.
Simple repro:
```python
import _io
class MyIO(_io.BytesIO):
def __init__(self):
_io.BytesIO.__init__(self)
self.writes = []
def write(self, b):
... | 52586f930f62bd80374f0f240a4ecce0c0238174 | 3ea9b92086240b2f38a74c6945e7a723b480cefe |
python/cpython | python__cpython-119470 | # test_pyrepl leaks references
Since commit fe921931a35b461fb81821a474b510f4d67c520b, test_pyrepl started to leak a lot of references.
```
commit fe921931a35b461fb81821a474b510f4d67c520b (HEAD)
Author: Lysandros Nikolaou <lisandrosnik@gmail.com>
Date: Mon May 20 17:57:32 2024 -0400
gh-111201: Add tests ... | 6e012ced6cc07a7502278e1849c5618d1ab54a08 | a192547dfe7c4f184cc8b579c3eff2f61f642483 |
python/cpython | python__cpython-119475 | # Py_buffer.format declaration inconsistent with the docs
# Bug report
### Bug description:
The declaration of the `format` field of the `Py_buffer` structure is `char *` but the documentation states it is `const char *`.
IMHO the declaration should be changed to match the docs.
### CPython versions tested on:
3.... | 3b26cd8ca0e6c65e4b61effea9aa44d06e926797 | c7a5e1e550a2a0bfa11dbf055ed4b7afb26b5fe9 |
python/cpython | python__cpython-120731 | # Python 3.13b repeatedly setting superclass attribute in subclass leads to crashes
# Crash report
### What happened?
I'm trying to run the [qutebrowser testsuite](https://qutebrowser.org/) with Python 3.13, and am running into an issue where a test reproducibly fails (usually by crashing the interpreter), but o... | 00257c746c447a2e026b5a2a618f0e033fb90111 | f385d99f57773e48285e0bcdbcd66dcbfdc647b3 |
python/cpython | python__cpython-121178 | # 1506-007 (S) "struct _dtoa_state" is undefined on AIX
# Bug report
### Bug description:
```python
bash-4.2$ ./configure
checking build system type... powerpc-ibm-aix7.2.3.0
checking host system type... powerpc-ibm-aix7.2.3.0
checking for Python interpreter freezing... ./_bootstrap_python
checking for python3.12...... | c3677befbecbd7fa94cde8c1fecaa4cc18e6aa2b | 48cd104b0cf05dad8958efa9cb9666c029ef9201 |
python/cpython | python__cpython-119493 | # pyrepl always has `from __future__ import annotations` on
# Bug report
### Bug description:
```
% ./python.exe
Python 3.14.0a0 (heads/main:e12a6780bb, May 22 2024, 13:54:40) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> def f(x: ... | a8e35e8ebad8c3bb44d14968aa05d1acbc028247 | 548a11d5cf1dbb32d86ce0c045130c77f50c1427 |
python/cpython | python__cpython-119435 | # REPL takes extra key presses on long inputs that wrap around lines
# Bug report
### Bug description:
The new REPL has an issue when outputting at the right edge of the console window. It tries to output a "\" at the end, and then print the typed character at the beginning of the next line. This works fine on the... | e3bf5381fd056d0bbdd775463e3724aab2012e45 | 9b422fc6af87b81812aaf3010c004eb27c4dc280 |
python/cpython | python__cpython-119444 | # ``test_monitoring`` leaks references
# Bug report
### Bug description:
```python
./python -m test -R 3:3 test_monitoring
Using random seed: 1027068683
0:00:00 load avg: 0.28 Run 1 test sequentially
0:00:00 load avg: 0.28 [1/1] test_monitoring
beginning 6 repetitions. Showing number of leaks (. for 0 or less, X for... | c85e3526736d1cf8226686fdf4f5117e105a7b13 | e3f5a4455346747fe98f6aeefc74b46048d09bda |
python/cpython | python__cpython-119392 | # The docstrings for PyMapping_Values, PyMapping_Items and PyMapping_Keys are incorrect
# Documentation
The docstring for `PyMapping_Keys`
> /* On success, return a list or tuple of the keys in mapping object 'o'.
does not reflect the documentation (see https://docs.python.org/3/c-api/mapping.html#c.PyMappin... | d472b4f9fa4fb6061588d421f33a0388a2005bc6 | 858b9e85fcdd495947c9e892ce6e3734652c48f2 |
python/cpython | python__cpython-119457 | # Invalid corner cases (resulting in nan+nanj) in complex division
# Bug report
### Bug description:
Reproducer:
```pycon
>>> (1+1j)/(cmath.inf+0j) # ok
0j
>>> (1+1j)/cmath.infj # ok
-0j
>>> (1+1j)/(cmath.inf+cmath.infj) # should be 0j, isn't?
(nan+nanj)
```
c.f. MPC:
```pycon
>>> gmpy2.mpc('(1+1j)... | 2cb84b107ad136eafb6e3d69145b7bdaefcca879 | 0a1e8ff9c15675fdc4d07fa6c59f83808bf00798 |
python/cpython | python__cpython-119528 | # Deadlock in `pool_in_threads.py` (`test_multiprocessing_pool_circular_import`) in free-threaded build
# Bug report
Running `pool_in_threads.py` in a loop will occasionally lead to deadlock even with #118745 applied.
Here's a summary of the state I observed:
### Thread 28
Thread 28 holds the GIL and is blocked on... | 078b8c8cf2bf68f7484cc4d2e3dd74b6fab55664 | 64ff1e217d963b48140326e8b63c62f4b306f4a0 |
python/cpython | python__cpython-119358 | # Increase coverage of test_pyrepl
When running the PyREPL tests, it gives back a code coverage percentage of about ~60% on the new `_pyrepl` module.
```
% ./python.exe ../coveragepy report --show-missing
Name Stmts Miss Branch BrPart Cover Missing
----------------------------... | 73ab83b27f105a4509046ce26e35f20d66625195 | c886bece3b3a49f8a0f188aecfc1d6ff89d281e6 |
python/cpython | python__cpython-122946 | # Add a ctypes.util function to list loaded shared libraries
# Feature or enhancement
### Proposal:
When writing code which loads dynamic libraries, it is often very useful to be able to query which shared libraries are already in use by the current process. There are a few well-known tricks to do this, but they all... | 421ea1291d9b8ebfe5eaa72ab041338073fb67d0 | 0f128b9435fccb296714f3ea2466c3fdda77d91d |
python/cpython | python__cpython-119353 | # Make `Py_BEGIN_CRITICAL_SECTION()` and `Py_END_CRITICAL_SECTION()` public in the non-limited C API
# Feature or enhancement
The critical section API is useful for making C API extensions thread-safe when the GIL is disabled. Compared to plain mutexes, the API makes it easier to avoid deadlocks, especially when in... | 8f17d69b7bc906e8407095317842cc0fd52cd84a | 03fa2df92707b543c304a426732214002f81d671 |
python/cpython | python__cpython-119418 | # '_PyLong_NumBits': identifier not found in 3.13
# Bug report
### Bug description:
While fixing pywin32 to let CI builds work in Python 3.13, the build process complained of not being able to find `_PyLong_NumBits`. All other Python versions in the CI built successfully.
```c
BOOL PyCom_VariantFromPyObject(PyObjec... | e50fac96e82d857ecc024b4cd4e012493b077064 | b1374aa1c2e68becf9b6dcdcb8a586b0bd997c0d |
python/cpython | python__cpython-119335 | # Add c-api to set callback function on enter and exit of PyContext
# Feature or enhancement
### Proposal:
In python every time a context is switched, two c-api are called.
```
PyContext_Enter(PyObject *);
PyContext_Exit(PyObject *);
```
I need a way to know when those api's are called on a context. The ... | d87482bc4ee9458d6ba16140e7bc008637dbbb16 | ad7c7785461fffba04f5a36cd6d062e92b0fda16 |
python/cpython | python__cpython-119319 | # Resolve deprecation warnings in Docs/tools
# Documentation
The following scripts are throwing deprecation warnings.
- Docs/tools/extensions/pyspecific.py
- Docs/tools/extensions/glossary_search.py
```
PendingDeprecationWarning: nodes.Node.traverse() is obsoleted by Node.findall()
```
<!-- gh-linked-prs ... | 0867bce45768454ee31bee95ca33fdc2c9d8b0fa | ffa24aab107b5bc3c6ad31a6a245c226bf24b208 |
python/cpython | python__cpython-119464 | # Unexpected name mangling behavior with generics
# Bug report
### Bug description:
Name mangling behaves inconsistently when used with generics. Here’s the code to reproduce the issue:
```python
class __Foo(type):
pass
class Bar[T](metaclass=__Foo):
pass
```
This raises `NameError: name '_Bar__Foo' is no... | a9a74da4a0ca0645f049e67b6434a95e30592c32 | 3e8b60905e97a4fe89bb24180063732214368938 |
python/cpython | python__cpython-119307 | # Break up _pyrepl tests
I'd like to work on increasing the test coverage of the new _pyrepl module:
```
% ./python.exe ../coveragepy report --show-missing
Name Stmts Miss Branch BrPart Cover Missing
-----------------------------------------------------------------------------... | f49df4f486e531ff2666eb22854117c564b3de3d | e03dde5a24d3953e0b16f7cdefdc8b00aa9d9e11 |
python/cpython | python__cpython-119293 | # Add job to `jit.yml` to build and test with `--disable-gil`
I recently fixed https://github.com/python/cpython/pull/118935, so I figure we probably want a job in the JIT CI that checks that nothing regresses over time.
<!-- gh-linked-prs -->
### Linked PRs
* gh-119293
* gh-119314
<!-- /gh-linked-prs -->
| c4722cd0573c83aaa52b63a27022b9048a949f54 | ab4263a82abe8b684d8ad1edf7c7c6ec286ff756 |
python/cpython | python__cpython-119657 | # `contextlib.suppress` converts instances of a subtype of `ExceptionGroup` to an instance of the `ExceptionGroup` class
# Bug report
### Bug description:
```python
from contextlib import suppress
class FooException(Exception): ...
class FooExceptionGroup(ExceptionGroup[Exception]): ...
try:
with suppress(Foo... | 5c02ea8bae2287a828840f5734966da23dc573dc | 983efcf15b2503fe0c05d5e03762385967962b33 |
python/cpython | python__cpython-119275 | # test_ioctl is skipped because of setsid()
Python test runner "regrtest" uses process groups to be able to kill child processes of worker processes. Tests are run in subprocesses to run them in parallel and to catch bugs.
Problem: if setsid() is called (after fork), test_ioctl fails to open `/dev/tty`.
I propos... | 1f481fd3275dbc12a88c16129621de19ea20e4ca | 055c739536ad63b55ad7cd0b91ccacc33064fe11 |
python/cpython | python__cpython-119480 | # is_dataclass() returns True for non-dataclass subclass of dataclass
# Bug report
### Bug description:
If a dataclass has a subclass that is not itself a dataclass, `is_dataclass()` returns True on the subclass and its instances:
```python
from dataclasses import dataclass, is_dataclass
@dataclass
class X:
y:... | bf4ff3ad2e362801e87c85fffd9e140b774cef26 | 0751511d24295c39fdf2f5b2255e3fa3d796ce4d |
python/cpython | python__cpython-119259 | # Tier 2 Optimizer Eliminate Type Version Guards
# Feature or Enhancement:
### Proposal:
_Note: I made this issue at the PyCon sprints discussing with @Fidget-Spinner and in collaboration with @dpdani_
The tier 2 optimizer should eliminate type version guards if it is safe to do.
It is safe if it has previ... | d8faa3654c2887eaa146dcdb553a9f9793bd2e5a | 6247fdbf93a8c72e1be40d396102b7f1a1271c95 |
python/cpython | python__cpython-119254 | # Import `_ios_support` raises RuntimeError on Windows
# Bug report
### Bug description:
See also:
- https://github.com/python/typeshed/actions/runs/9161558906/job/25186691740?pr=11987
- https://github.com/python/mypy/pull/17270
### CPython versions tested on:
3.13
### Operating systems tested on:
Windows
<!-- ... | bf17986096491b9ca14c214ed4885340e7857e12 | 8231a24454c854ea22590fd74733d29e4274122d |
python/cpython | python__cpython-119315 | # PySequence_Fast needs new macros to be safe in a nogil world
# Feature or enhancement
### Proposal:
Right now, most uses of `PySequence_Fast` are invalid in a nogil context when it is passed an existing `list`; `PySequence_FAST_ITEMS` returns a reference to the internal array of `PyObject*`s that can be resize... | baf347d91643a83483bae110092750d39471e0c2 | 2b3fb767bea1f96c9e0523f6cc341b40f0fa1ca1 |
python/cpython | python__cpython-119877 | # C API Extension Support for Freethreading HOWTO
We should add a "HOWTO" guide for C API extension authors covering how to support the free-threaded build.
See also https://peps.python.org/pep-0703/#how-to-teach-this
<!-- gh-linked-prs -->
### Linked PRs
* gh-119877
* gh-120693
* gh-124368
<!-- /gh-linked-prs -->... | 02b272b7026b68e70b4a4d9a0ca080904aed374c | dacc5ac71a8e546f9ef76805827cb50d4d40cabf |
python/cpython | python__cpython-119223 | # Remove legacy TODOs from code.
# Bug report
### Bug description:
I left a few TODOs in the compiler code from its early development. They are no longer relevant. For example, they comment on issues to consider that do not appear to have been a priority in years.
### CPython versions tested on:
CPython main bran... | 19c11f244ebef492a5b20cd85a3b2e213e85388d | 6f7dd0a4260254390d75838c84ccc7285a2264f0 |
python/cpython | python__cpython-119229 | # Warning on autocomplete messes up the terminal
# Bug report
### Bug description:
1. Open `./python.exe`
2. `import sys; code = sys._getframe(1).f_code`
3. Type `code.co_` and hit tab
4. This:
<img width="1332" alt="Screenshot 2024-05-20 at 6 52 31 AM" src="https://github.com/python/cpython/assets/906600/11673a91-e... | 506b1a3ff66a41c72d205c8e4cba574e439d8e76 | a3e4fec8734a304d654e4ae24a4aa2f41a7b0640 |
python/cpython | python__cpython-119236 | # Fraction wrongfully gets casted into float when given as argument to __rpow__
# Bug report
### Bug description:
When using the `**` operator with a Fraction as a base and an object that implements `__rpow__` as an exponent the fraction gets wrongfully casted into a float before being passed to `__rpow__`
```pytho... | fe67af19638d208239549ccac8b4f4fb6480e801 | 034cf0c3167c850c8341deb61e210cb0dbcdb02d |
python/cpython | python__cpython-118881 | # ipython breaks on Python-3.13.0b1 when a 'tempfilepager' is not defined
# Bug report
### Bug description:
on a windows Python-3.13.0b1 non-english
test:
```python
Python 3.13.0b1 (tags/v3.13.0b1:2268289, May 8 2024, 12:20:07) [MSC v.1938 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more... | 05e1dce76d7669e90ab73e7e682360d83b8a0d02 | bbb49888a752869ae93423c42039a3a8dfab34d4 |
python/cpython | python__cpython-119184 | # [C API] Add an efficient public PyUnicodeWriter API
# Feature or enhancement
Creating a Python string object in an efficient way is complicated. Python has **private** `_PyUnicodeWriter` API. It's being used by these projects:
Affected projects (5):
* Cython (3.0.9)
* asyncpg (0.29.0)
* catboost (1.2.3)
* ... | 5c4235cd8ce00852cfcb2d3a2cb4c66c6c53c4bf | 2c7209a3bdf81a289ccd6b80a77497cfcd5732de |
python/cpython | python__cpython-119209 | # Implement PEP 649 and PEP 749
PEP-649 has been accepted and should be implemented in Python 3.14. Let's use this issue to track the implementation:
- [x] Decide on or clarify the adoption strategy (https://discuss.python.org/t/pep-649-deferred-evaluation-of-annotations-tentatively-accepted/21331/44)
- [x] Add new `... | e9875ecb5dd3a9c44a184c71cc562ce1fea6e03b | 73ab83b27f105a4509046ce26e35f20d66625195 |
python/cpython | python__cpython-119175 | # [Windows] High DPI causes tkinter turtledemo windows blurry
# Feature or enhancement
## Comparison
Here is a side by side comparison of both tkinter turtle-graphics examples windows, with and without the GUI fix. Maybe the screenshot was reduced by me so that the difference was not obvious, but actually before t... | 538ed5e4818aa0d0aa759634e8bfa23e317434a1 | 172690227e771c2e8ab137815073e3a172c08dec |
python/cpython | python__cpython-119147 | # Update `paths` in `jit.yml`
Per https://github.com/python/cpython/pull/118983#issuecomment-2115553477
<!-- gh-linked-prs -->
### Linked PRs
* gh-119147
* gh-119226
* gh-120435
* gh-120447
* gh-120448
<!-- /gh-linked-prs -->
| 5307f44fb983f2a17727fb43602f5dfa63e93311 | 697465ff88e49d98443025474e5b534adfba2cb0 |
python/cpython | python__cpython-119134 | # Python -VV should display whether the build is default build or free-threading.
Currently, there is no way to identify whether the build is free-threaded or not through `python -VV`
See the pyperf and pyperformance case
* https://github.com/psf/pyperf/pull/189
* https://github.com/python/pyperformance/pull/336
... | c141d4393750c827cbcb3867f0f42997a3bb3528 | 691429702f1cb657e65f4e5275bb5ed16121d2b7 |
python/cpython | python__cpython-119173 | # `asyncio.staggered` is missing `typing` import
# Bug report
### Bug description:
`asyncio/staggered.py` is using `typing.Optional`:
https://github.com/python/cpython/blob/65de194dd80bbc8cb7098d21cfd6aefd11d0d0ce/Lib/asyncio/staggered.py#L73
However, #114281 removed the `typing` import. This causes test failures ... | 16b46ebd2b0025aa461fdfc95fbf98a4f04b49e6 | 357f5a1f73684d0c126a5e8f79d76ff3641c4d52 |
python/cpython | python__cpython-119615 | # `tokenize.generate_tokens()` performance regression in 3.12
# Bug report
### Bug description:
There seems to be a significant performance regression in `tokenize.generate_tokens()` between 3.11 and 3.12 when tokenizing a (very) large dict on a single line. I searched the existing issues but couldn't find anyth... | d87b0151062e36e67f9e42e1595fba5bf23a485c | ae9140f32a1630838374f1af402291d4649a0be0 |
python/cpython | python__cpython-119124 | # pathlib.Path.with_suffix(None) became allowed in Python 3.13b1
# Bug report
### Bug description:
In Python 3.13b1 (compared to Python 3.12 and earlier), the behavior of `pathlib.Path.with_suffix(None)` changed from raising an incidental `TypeError` to removing the suffix. This casues a [certain test](https://githu... | 3c28510b984392b8dac87a17dfc5887366d5c4ab | 4b7667172898d440c1931ae923446c6a5ef1765e |
python/cpython | python__cpython-119131 | # difflib.py Differ.compare is too slow [for degenerate cases]
# Bug report
### Bug description:
```python
import difflib
a = ["0123456789\n"] * 1_000
b = ["01234a56789\n"] * 1_000
list(difflib.Differ().compare(a, b)) # very slow and will probably hit max recursion depth
```
The case is pathological in ... | 0abf997e75bd3a8b76d920d33cc64d5e6c2d380f | 3c28510b984392b8dac87a17dfc5887366d5c4ab |
python/cpython | python__cpython-119269 | # New pyrepl gives a traceback on exit with "dumb" terminal
# Bug report
### Bug description:
I was experimenting with terminal types:
```
$ export TERM=dumb
$ python3
Python 3.13.0b1 (main, May 12 2024, 23:38:03) [GCC 13.2.1 20240316 (Red Hat 13.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for... | 73f4a58d36b65ec650e8f00b2affc4a4d3195f0c | b36533290608aed757f6eb16869a679650d32e17 |
python/cpython | python__cpython-119129 | # venv tutorial wrong/confusing about python version used
# Documentation
From https://docs.python.org/3/tutorial/venv.html:
> [venv](https://docs.python.org/3/library/venv.html#module-venv) will usually install the most recent version of Python that you have available. If you have multiple versions of Python on... | 0f5e8bed636c2f29701e5a1965d1b088d33abbf0 | 81c3130c51a2b1504842cb1a93732cc03ddbbd79 |
python/cpython | python__cpython-119426 | # Version numbers not supported for shebang line virtual command /usr/bin/env python on windows
# Documentation
In section 4.8.2 of the docs (Shebang Lines), it is stated that: "Any of the above virtual commands can be suffixed with an explicit version (either just the major version, or the major and minor version)... | df93f5d4bf9d70036d485666d4dd4f009d37f8b9 | fcca08ec2f48f4ba5ba1d4690fb39b1efe630944 |
python/cpython | python__cpython-119065 | # Test with the path protocol, not with pathlib.Path
A number of tests use `pathlib.Path` to test that the code supports path-like objects. They should use a special object that only implements the path protocol instead. This will avoid unintentional dependency on other `pathlib.Path` methods and attributes and allow ... | 0152dc4ff5534fa2948b95262e70ff6b202b9b99 | 0142a2292c3d3bfa56a987d576a9678be0f56931 |
python/cpython | python__cpython-119066 | # Make ZeroDivisionError message more precise when floor-dividing by zero
# Feature or enhancement
### Proposal:
```python
try:
10 // 0
except ZeroDivisionError as e:
print(e) #returns integer division or modulo by zero
try:
10 / 0
except ZeroDivisionError as e:
print(e) #returns integer division by zero
t... | 1d4c2e4a877a48cdc8bcc9808d799b91c82b3757 | 153b118b78588209850cc2a4cbc977f193a3ab6e |
python/cpython | python__cpython-119055 | # Documentation of pathlib.Path methods is disorganised
# Documentation
The docs for [`pathlib.Path` methods](https://docs.python.org/3.14/library/pathlib.html#methods) is disorganised. It was originally alphabetical, but over the last few years we've begun moving similar methods together. We ought to split it up i... | 81d63362302187e5cb838c9a7cd857181142e530 | 045e195c76f33c77c339284b13f81102e4b9abe2 |
python/cpython | python__cpython-119112 | # Implement the fast path for `list.__getitem__`
# Feature or enhancement
### Proposal:
Implement the fast path for `list.__getitem__` [outlined in PEP-703](https://peps.python.org/pep-0703/#optimistically-avoiding-locking).
### Has this already been discussed elsewhere?
This is a minor feature, which does not ne... | ab4263a82abe8b684d8ad1edf7c7c6ec286ff756 | 73f4a58d36b65ec650e8f00b2affc4a4d3195f0c |
python/cpython | python__cpython-119063 | # Defer `import warnings` in pathlib
As of GH-118793, the `warnings` module is used only once in pathlib, by `PurePath.is_reserved()`. We should be able to move the `import warnings` line into that method. But beware! Doing so seems to cause a failure in `test_io`, which needs further investigation.
<!-- gh-linked-pr... | 100c7ab00ab66a8c0d54582f35e38d8eb691743c | 4702b7b5bdc07d046576b4126cf4e4f5f7145abb |
python/cpython | python__cpython-119248 | # Python 3.13.0b1 REPL does not travel words when pressing Ctrl+← or Ctrl+→
# Bug report
### Bug description:
When I type this to older Python REPLs:
```pycon
>>> text = "I can travel the words."
```
And I press <kbd>Ctrl</kbd>+<kbd>←</kbd>, my cursor moves in front of `w`. I can press <kbd>Ctrl</kbd>+<kbd>←</kbd>... | 0398d9339217aa0710c0de45a7e9b587136e7129 | c4722cd0573c83aaa52b63a27022b9048a949f54 |
python/cpython | python__cpython-123607 | # Python 3.13.0b1 REPL changes behavior wrt PgUp, inserts first line of ~/.python_history
# Bug report
### Bug description:
When I use the Python REPL, I am used to <kbd>PgUp</kbd> browsing my prompt history based on the partial command I already typed.
Consider:
```pycon
>>> import sys
>>> import os
>>> ...
>>> i... | 8311b11800509c975023e062e2c336f417c5e4c0 | d683f49a7b0635a26150cfbb398a3d93b227a74e |
python/cpython | python__cpython-119130 | # Classes tutorial: confusing explanation of non-instance methods
# Documentation
From https://docs.python.org/3/tutorial/classes.html#instance-objects:
> The other kind of instance attribute reference is a method. A method is a function that “belongs to” an object. (In Python, the term method is not unique to c... | c618f7d80e78f83cc24b6bdead33ca38cbd4d27f | 53b1981fb0cda6c656069e992f172fc6aad7c99c |
python/cpython | python__cpython-119296 | # `functools.update_wrapper` does not work with `type`
# Bug report
### Bug description:
```python
from functools import update_wrapper
def my_type(*args): pass
t = update_wrapper(my_type, type)
```
This works on Python ≤ 3.11, and I think this is expected because the docs for `update_wrapper` claim that it may b... | 6b240c2308a044e38623900ccb8fa58c3549d4ae | ae11d68ab90324a3359699ca13fcf9a229966713 |
python/cpython | python__cpython-119012 | # Missing `__type_params__` in the documentation of `functools.update_wrapper`.
# Documentation
The description of the default `WRAPPER_ASSIGNMENTS` in the [docs](https://docs.python.org/3/library/functools.html#functools.update_wrapper) for `functools.update_wrapper` omits the `__type_params__` attribute, which is... | b04c497f187b0b474e431a6d8d282269b40ffe52 | 7d7eec595a47a5cd67ab420164f0059eb8b9aa28 |
python/cpython | python__cpython-119006 | # Add gettext target to documentation's Makefile
# Feature or enhancement
### Proposal:
As some may know already, Sphinx's _gettext_ builder is used to extract strings from the docs and store them in message catalog templates (pot files).
Currently there is no straightforward `make gettext` command to generate pot ... | fb0cf7d1408c904e40142a74cd7a53eb52a8e568 | 5b88d95cc542cf02303c6fe0e8719a93544decdb |
python/cpython | python__cpython-121329 | # Crash in OrderedDict similiar to #83771
# Bug report
### Bug description:
```python
import collections
global count
count = 0
class Evil():
def __eq__(self, other):
global count
print(count)
if count == 1:
l.clear()
print("cleared l")
count += 1
... | 38a887dc3ec52c4a7222279bf4b3ca2431b86de9 | e80dd3035fb805716bc49f9e7e9cab5f83614661 |
python/cpython | python__cpython-119935 | # library/stdtypes.html - Mutable Sequence Types - Operations Table - Slice Assignments
# Documentation
The table of operations for [mutable sequence types](https://docs.python.org/3/library/stdtypes.html#mutable-sequence-types) has footnote (1) for the operation `s[i:j:k] = t`, which states that "_t_ must have the... | 462832041e342f8aaf8c88ec44f7b14c70042575 | 1dadcb5a6a821dd6ab397cf52a2fa9618839d8c0 |
python/cpython | python__cpython-118999 | # Handle errors correctly in `tmtotuple` in `timemodule`
# Bug report
This call is problematic: https://github.com/python/cpython/blob/f526314194f7fd15931025f8a4439c1765666e42/Modules/timemodule.c#L465
It can return `NULL` in theory.
These calls also can return `NULL`:
- https://github.com/python/cpython/bl... | fc757925944a9486d4244853dbe6e37ab3e560c2 | b04c497f187b0b474e431a6d8d282269b40ffe52 |
python/cpython | python__cpython-126768 | # "Windows fatal Exception: access violation" while testing 3.13.0b1 free-threading build (related to tkinter ?)
# Crash report
### What happened?
doing pytest on my github repository ["sqlite-bro"](https://github.com/stonebig/sqlite_bro) , with Python-3.13.0b1 augmented per:
- "with free-threading binaries dow... | 9332a6f82506f819f591466eb03213be2c8d1808 | d4c72fed8cba8e15ab7bb6c30a92bc9f2c8f0a2c |
python/cpython | python__cpython-118960 | # `asyncio.sslproto._SSLProtocolTransport` can experience invalid state, leading to silent failures.
# Bug report
### Bug description:
## TL;DR
`_SSLProtocolTransport.is_closing` should match its inner `_SelectorTransport.is_closing`, indicating to the user that the transport is actually closed instead of silently... | 3f24bde0b6689b8f05872a8118a97908b5a94659 | 41bd9d959ccdb1095b6662b903bb3cbd2a47087b |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.