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-123778 | # PyObject_GetBuffer(PyBUF_FORMAT) breaks on a memoryview
# Bug report
### Bug description:
Calling `PyObject_GetBuffer()` with the `PyBUF_FORMAT` flag on a memoryview object that wraps a bytes object fails with the exception:
`BufferError: memoryview: cannot cast to unsigned bytes if the format flag is present`
... | 962304a54ca79da0838cf46dd4fb744045167cdd | fb1b51a58df4315f7ef3171a5abeb74f132b0971 |
python/cpython | python__cpython-123582 | # Match statement's `signed_number` token is not properly defined
# Documentation
It seems that the last line in the following production list intended to define the token `signed_number` but mistakenly put it inside the definition of `literal_pattern`.
https://github.com/python/cpython/blob/91b7f2e7f6593acefda4... | 9e079c220b7f64d78a1aa36a23b513d7f377a694 | 9684f40b9f51816fd326f1b4957ea5fb5b5922c8 |
python/cpython | python__cpython-123612 | # Document "!" token in lexical analysis document
# Documentation
I think after [PEP701](https://peps.python.org/pep-0701/) The `!` character became a token.
But this is not listed like other tokens:
- https://docs.python.org/3/reference/lexical_analysis.html#delimiters
- https://docs.python.org/3/reference/lexi... | 68fe5758bf1900ffdcdf7cd9e40f5018555a39d4 | 782217f28f0d67916fc3ff82b03b88573686c0e7 |
python/cpython | python__cpython-123571 | # Improve `weakref_slot` docs in `dataclasses.rst`
While merging https://github.com/python/cpython/pull/123342 I've noticed that we can improve `weakref_slot` docs. Here's how it looks now:
<img width="759" alt="Снимок экрана 2024-09-01 в 13 53 28" src="https://github.com/user-attachments/assets/318b56f5-46b5-4994-b4... | c3ed775899eedd47d37f8f1840345b108920e400 | 88210c295d51364c9f779989bc528084b8fe8765 |
python/cpython | python__cpython-123563 | # Improve `SyntaxError` message for `case ... as a.b`
# Feature or enhancement
There's already a similar rule: https://github.com/python/cpython/blob/084e0f35d1492495b01e7cf24c3106849e854188/Grammar/python.gram#L1378
But, it has two problems:
1. It does not work for cases like `as a.b`, because `a` matches `NAME`
2.... | 23f159ae711d84177e8ce34cd9a6c8a762de64ac | c3ed775899eedd47d37f8f1840345b108920e400 |
python/cpython | python__cpython-123561 | # Invalid description for '' (None) formatting type for floats
Docs [says](https://docs.python.org/3.12/library/string.html#format-specification-mini-language), that if format type is not specified:
"For [float](https://docs.python.org/3.12/library/functions.html#float) this is the same as 'g', except that when fixed... | 274d9ab619b8150a613275835234ea9ef935f21f | 19fed6cf6eb51044fd0c02c6338259e2dd7fd462 |
python/cpython | python__cpython-123554 | # New warning: `‘compiler_is_top_level_await’ defined but not used [-Wunused-function]`
# Bug report
### Bug description:
Popped up in https://github.com/python/cpython/pull/123546/files
I have a PR ready.
### CPython versions tested on:
CPython main branch
### Operating systems tested on:
Linux
... | 084e0f35d1492495b01e7cf24c3106849e854188 | bac0e115b8c439def509053c71a6c20651348313 |
python/cpython | python__cpython-123551 | # Incorrect code snippet for `BUILD_TUPLE` in `dis` docs
# Documentation
The code snippet in the docs removes the last *count* items from the stack before creating the tuple instead of first creating the tuple from the last *count* items and then removing them from the stack.
https://github.com/python/cpython/bl... | bac0e115b8c439def509053c71a6c20651348313 | 0ff59d707ce33c2fd7390d473a5779a3d16a5764 |
python/cpython | python__cpython-123546 | # Remove duplicative `Py_DECREF` when handling `_PyOptimizer_Optimize` errors
There are two places in the code where we call `Py_DECREF` twice when `_PyOptimizer_Optimize` returns `-1`. In both cases, we do so in the conditional block and then as part of the `GOTO_UNWIND` macro. This never really happens in practice, ... | 1fbc118c5d3916e920a57cda3cb6d9a0292de26e | aa1339aaaa6363c38186defaa079d069b4cb08b2 |
python/cpython | python__cpython-123629 | # Improve `SyntaxError` message for `import a as b.c`
# Feature or enhancement
Right now it shows:
```python
>>> import a as b.c
File "<unknown>", line 1
import a as b.c
^
SyntaxError: invalid syntax
```
Proposed message:
```python
>>> import a as b.c
File "<unknown>", line... | a6ddd078d050bc501817d8afe27fab2777a482aa | 39afd290ae2b086bc1e7c560229164ead22cd9c4 |
python/cpython | python__cpython-123544 | # Move typing-related usage of PEP585 generics from `typing` docs to `collections.abc`
# Documentation
As pointed out in #123521, currently we have typing-related usage of PEP585 generics (`Generator`, `Callable`, `Coroutine`, etc.) explained on [`typing`](https://docs.python.org/3/library/typing.html#typing.Genera... | 56e4a417ce170e5c538ce9aafccf3333e7bf7492 | d343f977ba89c415aa4dcaf75122e0b4235d4fb1 |
python/cpython | python__cpython-123518 | # Remove unnecessary `:meth:` parentheses
# Documentation
Follow up with #123492 and sphinx-lint's [issue](https://github.com/sphinx-contrib/sphinx-lint/issues/114).
It's suggested that the unnecessary parentheses with meth role should also be fixed ([ref](https://github.com/sphinx-doc/sphinx/issues/12847#issuecom... | cf472577e24911cb70b619304c0108c7fba97cac | 34ddb64d088dd7ccc321f6103d23153256caa5d4 |
python/cpython | python__cpython-123505 | # `_tkinter` leaks type references on initialization
# Bug report
### Bug description:
Reproducer:
```
$ ./python -Xshowrefcount -c "import tkinter"
```
Seems to be caused by the use of `AddObjectRef` on a strong reference in the `_tkinter` initialization function, causing a double `Py_INCREF`.
### CPython version... | a8bc03696c7c2c03e1d580633151ec7b850366f3 | cfbc841ef3c27b3e65d1223bf8fedf1f652137bc |
python/cpython | python__cpython-123495 | # The return types for `webbrowser`'s API aren't documented
# Documentation
Related to https://stackoverflow.com/a/78930912/51685, it isn't clear that `webbrowser.open()` and friends return booleans.
(I have a PR fired up for this.)
<!-- gh-linked-prs -->
### Linked PRs
* gh-123495
* gh-123548
* gh-123549
<!-- ... | 0b6acfee04b30e7993314723c614625ddd90ae6e | 917283ada6fb01a3221b708d64f0a5195e1672dc |
python/cpython | python__cpython-123493 | # Remove unnecessary `:func:` parentheses
# Documentation
The func role's parentheses are unnecessary as Sphinx will add them to the rendered output.
```rst
.. bad
:func:`!locale.resetlocale()`
.. good
:func:`!locale.resetlocale`
```
We're introducing a new rule to the sphinx-lint ([issue](https://gith... | 103a0470e31d80d56097f57a27d97d7d2d3c9fbb | 8aaf7525ab839c32966ee862363ad2543a721306 |
python/cpython | python__cpython-123485 | # _Py_DebugOffsets for PyLongObject are incorrect
# Bug report
### Bug description:
All other debug offsets are relative to the start of the object, but the offsets for PyLongObject's fields are relative to the start of an inner object, and so each field's value is too small by `sizeof(PyObject)`.
### CPython vers... | 7fca268beee8ed13a8f161f0a0d5e21ff52d1ac1 | 103a0470e31d80d56097f57a27d97d7d2d3c9fbb |
python/cpython | python__cpython-123478 | # TCP_QUICKACK is available on Windows, but is only implemented by the python runtime for Linux
# Bug report
### Bug description:
```python
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_QUICKACK, 1)
sock.getsockopt(socket.IPPROTO_TCP, so... | b5aa271f86229f126c21805ff2bd3b95526818a4 | 6e43928831a6f62b40f5e43ad4c12eff0a5f8639 |
python/cpython | python__cpython-123474 | # C API: `PyType_FromSpec()`: `__vectorcalloffset__` (and other special offset members) does not support `Py_RELATIVE_OFFSET`
# Bug report
### Bug description:
When declaring members of custom types via `PyType_FromSpec()`, it is advisable to rely on `Py_RELATIVE_OFFSET` to declare their position using a *relative* ... | 16be8db6bec7bf8b58df80601cab58a26eee4afa | ce9f84a47bfbafedd09a25d0f6f0c8209550fb6c |
python/cpython | python__cpython-123464 | # Logging flow chart missing from PDF
# Documentation
gh-121035 changed the format of the logging HOWTO flow chart from PNG to SVG. This broke the inclusion of the flow chart in the PDF doc build.
<!-- gh-linked-prs -->
### Linked PRs
* gh-123464
* gh-123666
* gh-123667
<!-- /gh-linked-prs -->
| 7d2c2f24daf7a2abd166bb51652ba55c6f55695f | c08ede27140121a919e884c7e8dfdce7b1a2e906 |
python/cpython | python__cpython-123507 | # python 3.12.5 new added build target _RegenSbom fails to build on windows
# Bug report
### Bug description:
```xml
<Target Name="Regen"
Condition="$(Configuration) != 'PGUpdate'"
DependsOnTargets="_TouchRegenSources;_RegenPegen;_RegenAST_H;_RegenOpcodes;_RegenTokens;_RegenKeywords;_Regen... | db42934270c5c23be9f6804cad98dfd8234caf6f | fbb26f067a7a3cd6dc6eed31cce12892cc0fedbb |
python/cpython | python__cpython-123449 | # Memory leak of `NoDefaultType` in `_typing`
# Bug report
### Bug description:
Quick reproducer:
```
$ ./python -X showrefcount -c "import _typing"
[8 refs, 0 blocks]
```
The underlying leaked object is `NoDefaultType`. I think this was caused by gh-118897 (cc @JelleZijlstra).
### CPython versions tested on:
C... | c9930f5022f5e7a290896522280e47a1fecba38a | b379f1b26c1e89c8e9160b4dede61b980cc77be6 |
python/cpython | python__cpython-123461 | # `PyArg_UnpackTuple` is used with `name=""`
# Bug report
### Bug description:
`PyArg_UnpackTuple(args, "",` causes empty name to be used in error messages:
```py
>>> str.join.__get__()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: expected at least 1 argument, got 0
# ... | 303f92a9ce0de3667fb6b3ed22fa3bea5f835066 | 0c3ea3023878f5ad5ca4680d5510da1fe208cbfa |
python/cpython | python__cpython-123483 | # calendar.day_name returns a class object and not array
# Documentation
In the https://docs.python.org/3/library/calendar.html#calendar.day_name, its mentioned day_name returns "An array that represents the days of the week in the current locale." but it returns a class object. Also, it would be helpful to provide... | 8447c933da308939b06e33544ca9abc9fc46aa8b | 0d38409f422b7be158a45e59766d8f4605dfa5df |
python/cpython | python__cpython-123442 | # Improve error message for `except a as b.c:` case
# Feature or enhancement
Right now the syntax error is not very clear:
<img width="788" alt="Снимок экрана 2024-08-28 в 21 00 51" src="https://github.com/user-attachments/assets/5d8a6a90-2151-4969-831b-f7af39692f70">
I propose to instead use something like:
<img wi... | e451a8937df95b2757b6def26b39aec1bd0f157f | d8e69b2c1b3388c31a6083cfdd9dc9afff5b9860 |
python/cpython | python__cpython-123434 | # Harmonize extension code checks in pickle
The C implementation of `pickle` checks (partially explicitly, partially implicitly) the type and the range of the value returned by the extension registry. These checks are redundant in normal circumstances, because it is already checked in `copyreg.add_extension()` which i... | 0c3ea3023878f5ad5ca4680d5510da1fe208cbfa | c9930f5022f5e7a290896522280e47a1fecba38a |
python/cpython | python__cpython-123475 | # Add `:root { color-scheme: light dark; }` to http.server directory list and error pages
# Feature or enhancement
### Proposal:
Allow browsers to apply light or dark themes to the http.server directory list according to the users prefered color scheme.
This can be done by adding the CSS [`color-scheme` property](h... | 9684f40b9f51816fd326f1b4957ea5fb5b5922c8 | 13f61bf7f1fb9b9b109b089610e845d98e6dc937 |
python/cpython | python__cpython-123429 | # Extract ZipInfo for archive functionality
In https://github.com/python/cpython/pull/123354, I found the need to copy code from zipfile into the test:
https://github.com/python/cpython/blob/9e108b8719752a0a2e390eeeaa8f52391f75120d/Lib/test/test_zipfile/_path/test_path.py#L662-L676
Let's instead extract that fun... | 7e819ce0f32068de7914cd1ba3b4b95e91ea9873 | ffece5590e95e89d3b5b6847e3beb443ff65c3db |
python/cpython | python__cpython-123673 | # OpenSSL vulnerability CVE-2024-2511
# Bug report
### Bug description:
### Description
Defender on Windows is detecting openssl vulnerabilities when python is installed.
Tested for Windows Python 3.11.9 and 3.12.15.
Defender is flagging vulnerabilities in the following files in Version 3.0.13:
C:\Python\DLLs\libc... | d2eafe2f48aac31aa8a152620bdfd0f2a274ee1d | a4562fedadb73fe1e978dece65c3bcefb4606678 |
python/cpython | python__cpython-123419 | # Incorrect ipaddress.ip_address.reverse_pointer with improved textual representation of IPv4-mapped IPv6 addresses
# Bug report
### Bug description:
I'm seeing strange results with python 3.13 with the `ipaddress.ip_address.reverse_pointer` attribute with the new improved textual representation of IPv4-mapped I... | 77a2fb4bf1a1b160d6ce105508288fc77f636943 | f95fc4de115ae03d7aa6dece678240df085cb4f6 |
python/cpython | python__cpython-123408 | # Docs: enable translations of code blocks
# Documentation
Code blocks, e.g. in the tutorial, include comments that are complement to the regular content of tutorial articles. An example in tutorial's introduction in [section “Numbers”](https://docs.python.org/3/tutorial/introduction.html#numbers):
```python
>>> ... | 5332d989af45378e6ae99aeda72bfa82042b8659 | 10bf615bab9f832971a098f0a42b0d617aea6993 |
python/cpython | python__cpython-123405 | # `http.cookies` module does not parse obsolete RFC 850 date format
# Bug report
### Bug description:
**Description**: According to [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-date-time-formats), a recipient that parses a timestamp value in an HTTP field MUST accept all three HTTP-date formats. T... | 359389ed51aecc107681e600b71852c0a97304e1 | b2ad7e0a2c1518539d9b0ef83c9f7a09d10fd303 |
python/cpython | python__cpython-123394 | # Document callables more explicitly
# Documentation
Currently, some options that expect callables [read like this in the documentation](https://docs.python.org/3/library/json.html#json.load):
> ```
> json.load(...)
> ```
>
> parse_constant, if specified, will be called with one of the following strings: '-I... | c08ede27140121a919e884c7e8dfdce7b1a2e906 | b423ae6b0879ab1b53c6f517274c0d9e0f235d78 |
python/cpython | python__cpython-124935 | # Incorrect handling of negative `start` values on `PyUnicodeErrorObject`
# Bug report
### Bug description:
Found when implementing #123343. We have:
```C
int
PyUnicodeEncodeError_GetStart(PyObject *exc, Py_ssize_t *start)
{
Py_ssize_t size;
PyObject *obj = get_unicode(((PyUnicodeErrorObject *)ex... | ba14dfafd97d1fd03938ac8ddec4ca5b2f12985d | 19984fe024bfd90649f1c36b78c9abf3ed72b27d |
python/cpython | python__cpython-123457 | # The canvas cannot be cleared after running turtledemo clock
# Bug report
### Bug description:
**First, run turtledemo clock. Then stop**
<img width="710" alt="2024-08-27 095034" src="https://github.com/user-attachments/assets/4dbe25e9-cbda-4d3d-be9e-ede39ed2af03">
When the clock stops running, the date... | c124577ebe915a00de4033c0f7fa7c47621d79e0 | 528bbab96feadbfabb798547e5bb2ad52070fb73 |
python/cpython | python__cpython-123387 | # CONTAINS_OP can provide the operation name
# Feature or enhancement
### Proposal:
When referring to the ```in``` and ```not in``` operator, the dis module does not display in ```COMPARE_OP``` which operator is being used
```python
>>> dis.dis('a in b')
0 0 RESUME 0
1 ... | 6a7765b9fad8bf67e2c118b637a516c5e6c42349 | 2231286d78d328c2f575e0b05b16fe447d1656d6 |
python/cpython | python__cpython-123346 | # Improve the documentation of `fnmatch`
The implementation of `fnmatch.fnmatch` calls `os.path.normcase` on both the filename and the pattern, also allowing path-like objects. On the other hand, `fnmatch.filter` call `os.path.normcase` to normalize the pattern as well as `os.path.normcase` on the filenames being iter... | 29fe8072cf404b891dde9c1d415095edddbe19de | b00e1254fc00941bf91e41138940e73fd22e1cbf |
python/cpython | python__cpython-123377 | # AST optimizer skips PEP 696 type parameter defaults
# Bug report
### Bug description:
```
>>> dis.dis("def f[T = 1 + 2](): pass")
... snip ...
L1: LOAD_CONST 0 (1)
LOAD_CONST 1 (2)
BINARY_OP 0 (+)
... snip ...
```
cc @Eclips4. This ... | be083cee34d62ae860acac70dfa078fc5c96ade3 | 9e108b8719752a0a2e390eeeaa8f52391f75120d |
python/cpython | python__cpython-123353 | # `tkinter.Event` is not subscriptable at runtime but generic in stub file
# Bug report
### Bug description:
```python
import tkinter
tkinter.Event[tkinter.Canvas] # TypeError: 'type' object is not subscriptable
```
This has been briefly discussed at https://github.com/python/typeshed/issues/12591
It would be great... | 42a818912bdb367c4ec2b7d58c18db35f55ebe3b | 64af2b29d2fcc4c4a305f970b6e81e7e79643b33 |
python/cpython | python__cpython-123348 | # dis: IS_OP should provide the name of the op
# Feature or enhancement
### Proposal:
`dis` output does not show which `IS_OP` is being used (0 = `is`, 1 = `is not`):
```
>>> dis.dis("a is b")
0 RESUME 0
1 LOAD_NAME 0 (a)
LOAD_NAME ... | 1eed0f968f5f44d6a13403c1676298a322cbfbad | 7bd6ebf696efcd5cf8e4e7946f9d8d8aee05664c |
python/cpython | python__cpython-123323 | # `PyOS_Readline` crashes in a multi-threaded race
# Crash report
### What happened?
The second breakpoint segfaults on Windows (==access violation).
```python
import asyncio
async def main():
def inner():
breakpoint()
pass
asyncio.create_task(asyncio.to_thread(inner))
asyncio.create_tas... | a4562fedadb73fe1e978dece65c3bcefb4606678 | c530ce1e9d336b81c053a5985444b4553fdd7050 |
python/cpython | python__cpython-123355 | # pickletools.dis() doesn't allow redefinition of memo items while pickle itself doesn't mind
# Bug report
### Bug description:
pickletools' disassembler has a [check here](https://github.com/python/cpython/blob/main/Lib/pickletools.py#L2497) that doesn't allow memo indices to be redefined, while the pickle.Unpickle... | e5a567b0a721c26c79530249d9aa159afbd11955 | 5332d989af45378e6ae99aeda72bfa82042b8659 |
python/cpython | python__cpython-123298 | # CPython does not record and propagate linker flags to LDCXXSHARED in sysconfig
CPython records and propagates several compilation-related flags from the time CPython is built, which in turn are used by `distutils` and `setuptools` to pass them to extension modules.
Unfortunately after https://github.com/pypa/dist... | c535a49e9260ad0fac022474f6381836051c9758 | 249b083ed8b3cfdff30bf578d7f9d3c5e982a4eb |
python/cpython | python__cpython-123276 | # PYTHON_GIL=1 and -Xgil=1 should work in non-free-threading builds
# Bug report
### Bug description:
In a non-free-threading build of Python 3.13, using environment variables or CLI arguments to ensure the GIL is used results in an error:
```console
$ PYTHON_GIL=1 python3.13
Fatal Python error: config_read_g... | 84ad264ce602fb263a46a4536377bdc830eea81e | 42f52431e9961d5236b33a68af16cca07b74d02c |
python/cpython | python__cpython-123272 | # Builtin zip method is not safe under free-threading
# Bug report
### Bug description:
A common optimization technique (used in `zip_next`) for methods generating tuples is to keep an internal reference to the returned tuple and when the method is called again check whether the internal tuple has reference coun... | 7e38e6745d2f9ee235d934ab7f3c6b3085be2b70 | d24d1c986d2c55933f89c6b73b2e618448115f54 |
python/cpython | python__cpython-123354 | # zipfile.Path regression
# Bug report
### Bug description:
#122906 introduced a regression with directories that look like Windows drive letters (on Linux):
```python
>>> import io, zipfile
>>> zf = zipfile.ZipFile(io.BytesIO(), "w")
>>> zf.writestr("d:/foo", "bar")
>>> zf.extractall("a")
>>> open("a/d:/foo").read... | 2231286d78d328c2f575e0b05b16fe447d1656d6 | 7e38e6745d2f9ee235d934ab7f3c6b3085be2b70 |
python/cpython | python__cpython-123255 | # Improve `tuple` C-API docs with better error info
There are multiple functions which do not declare:
- That they can return `NULL`
- That they also set an exception on error
I will send a PR.
<!-- gh-linked-prs -->
### Linked PRs
* gh-123255
* gh-123415
* gh-123416
<!-- /gh-linked-prs -->
| 6f563e364d1a7902417573f842019746a79cdc1b | 6a7765b9fad8bf67e2c118b637a516c5e6c42349 |
python/cpython | python__cpython-123244 | # `_decimal` leaks references
# Bug report
### Bug description:
The following leaks can be seen since a43cc3fa1ffebfd15eff2c6d8e5433a17969e348, fb0d9b9ac1ec3ea13fae8b8ef6a4f0a5a80482b3:
```py
>python -X showrefcount -c "import _decimal"
[7117 refs, 4232 blocks]
```
### CPython versions tested on:
... | 5ff638f1b53587b9f912a18fc776a2a141fd7bed | 556e8556849cb9df0666629b0f564b5dd203344c |
python/cpython | python__cpython-124557 | # ModuleType.__annotations__ and type.__annotations__ result in AttributeError
# Bug report
### Bug description:
If you call dir() on ModuleType or type, it shows `__annotations__` as one of the attributes. However, when you attempt to access that attribute, for ModuleType you get `AttributeError: type object 'modul... | 99b23c64de301c9e77add6b0d8e60118ef807840 | bc543936ab4ca3625bd7cbeac97faa47f5fd93dc |
python/cpython | python__cpython-123274 | # input audit hook is not called from new repl
# Bug report
### Bug description:
sorry, another pretty strange corner case that probably doesn't matter, but I still wanted to report it.
In the new repl, calling `input` does not trigger the audit-hook for `input` any more, because the builtin is replaced with a pyre... | aa1339aaaa6363c38186defaa079d069b4cb08b2 | 327463aef173a1cb9659bccbecfff4530bbe6bbf |
python/cpython | python__cpython-123236 | # "Deferred by Instruction" stats don't add up.
# Bug report
### Bug description:
The "Deferred by instruction" [stats](https://github.com/faster-cpython/benchmarking-public/blob/main/results/bm-20240819-3.14.0a0-e077b20-PYTHON_UOPS/bm-20240819-azure-x86_64-python-e077b201f49a6007ddad-3.14.0a0-e077b20-pystats.md#def... | 0b0f7befaddb2b5eff2811398a0f0d4604a82a90 | 5fce482c9a9d18d36c8177bdd0028cd2fef9f09f |
python/cpython | python__cpython-123263 | # New valgrind warning in Python 3.12.5
# Bug report
### Bug description:
I’ve just started seeing a Valgrind (1:3.18.1-1ubuntu2) warning in a Linux (ubuntu-22.04) Github test that started happening today when the Python version changed from 3.12.4 to 3.12.5.
The test is the pytest test suite in PyMuPDF - see https... | adc5190014efcf7b7a4c5dfc9998faa8345527ed | 0b0f7befaddb2b5eff2811398a0f0d4604a82a90 |
python/cpython | python__cpython-123281 | # _pyrepl.readline._ReadlineWrapper.get_line_buffer should return a `str`, not a `bytes` object
# Bug report
### Bug description:
`_pyrepl.readline._ReadlineWrapper.get_line_buffer` should return a `str`, not a `bytes` object, because `readline.get_line_buffer` also returns an `str`, not a `bytes`.
this has very li... | ca18ff2a34435faa557f7f9d4d3a554dadb05e50 | c4ee4e756a311f03633723445299bde90eb7b79c |
python/cpython | python__cpython-123214 | # Element.extend hides exceptions from underlying generators.
# Bug report
### Bug description:
```python
>>> from xml.etree.ElementTree import Element
>>> Element("a").extend(Element("a") for i in range(10)) # works
>>> Element("a").extend(1/0 for i in range(10)) # throws unrelated TypeError
Traceback (most... | 90b6d0e0f8f07d7443695e14a18488cb499d3b4d | a64aa47302bad05c4cd2e98d54e39a33722bf54f |
python/cpython | python__cpython-123417 | # `super` builtin class
# Documentation
I found the leading sentence in this paragraph a little misleading:
https://github.com/python/cpython/blob/ec89620e5e147ba028a46dd695ef073a72000b84/Doc/library/functions.rst?plain=1#L1961
because if the `object_or_type` is an object, it won't have `__mro__` attribute. The a... | 327463aef173a1cb9659bccbecfff4530bbe6bbf | 092abc4060768f2ae8b7b9c133558bf05bfeff88 |
python/cpython | python__cpython-123206 | # New warnings: ` 'initializing': conversion from '__int64' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]`
# Bug report
### Bug description:
Popped up in https://github.com/python/cpython/pull/123203/files
### CPython versions tested on:
CPython main branch
### Operating syste... | 67f2c84bff06eb837fd5ca64466d79f038e22ef8 | d7ae4dc5c14bc014ca0c056dab54c86ba8f395cb |
python/cpython | python__cpython-123200 | # The stats for "deferred" instructions (tier 1 specialization) are incorrect.
From a recent stats run:
### Execution counts
LOAD_ATTR 577 million
### Specialization stats
#### LOAD_ATTR
deferred 837 million
The number of deferred `LOAD_ATTR`s cannot exceed the number of `LOAD_ATTR`s executed, but the stats sa... | 7b26c4d1e3a856b9a377c57cffc3e7b3921d18bb | 1eba8bae9223600677dfa3a4ce8b7e4d2b8fd00d |
python/cpython | python__cpython-123190 | # New warnings: `./Modules/blake2module.c:314:18: warning: unused variable 'st' [-Wunused-variable]`
# Bug report
### Bug description:
```bash
admin@Admins-MacBook-Air ~/P/cpython (main)> make -j
gcc -I./Modules/_hacl/include -fno-strict-overflow -Wsign-compare -g -Og -Wall -fstack-protector-strong -std=c11 -Wex... | 8aaf7525ab839c32966ee862363ad2543a721306 | f8a736b8e14ab839e1193cb1d3955b61c316d048 |
python/cpython | python__cpython-123194 | # ``test_dataclasses`` fails with a segfault in hunt refleaks mode
# Bug report
### Bug description:
```python
eclips4@nixos ~/p/p/cpython (main)> ./python -m test -R 3:3 test_dataclasses
Using random seed: 315532800
0:00:00 load avg: 0.96 Run 1 test sequentially in a single process
0:00:00 load avg: 0.96 [1/1] test... | 1eba8bae9223600677dfa3a4ce8b7e4d2b8fd00d | 90c892efeaae28bd849a01b42842f19dcd67b9f4 |
python/cpython | python__cpython-123267 | # Pasting long line in new REPL causes text to appear after >>>
# Bug report
### Bug description:
When I paste code that is one line and my REPL window is small the text that would not be shown because it is offscreen is displayed after pressing enter.
For example I am pasting
```Python
thread = threading.Thread(t... | fdb3f9b588f58f3cf95fe1dbf6e5b61ef525a351 | c535a49e9260ad0fac022474f6381836051c9758 |
python/cpython | python__cpython-123168 | # Add `show_positions` keyword argument to `dis.dis` and related functions
# Feature or enhancement
### Proposal:
`dis.dis` is a useful debugging tool when trying to debug minor bytecode compiler errors.
However it lacks one important feature, the ability to see the exact positions attached to instructions. It... | b1d3bd2e09d8b9d9f49cb8db9d47880ce2ec8f70 | 94036e43a83e8993f6ff42408759091b7c60d17d |
python/cpython | python__cpython-125607 | # Free-threaded builds with PGO fail to build on Windows
# Bug report
### Bug description:
I don't consider this a high-priority bug, since free threading remains experimental, however it does prevent us from getting accurate benchmarking figures for free-threaded builds on Windows.
Building with
```
PCbuild\bui... | 37986e830ba25d2c382988b06bbe27410596346c | dbcc5ac4709dfd8dfaf323d51f135f2218d14068 |
python/cpython | python__cpython-123151 | # The repr() of the input function is absurdly long
# Bug report
### Bug description:
```python
>>> input
<bound method _ReadlineWrapper.input of _ReadlineWrapper(f_in=0, f_out=1, reader=ReadlineAlikeReader(console=WindowsConsole(screen=['\x1b[1;35m>>> \x1b[0minput'], height=35, width=140), buffer=['i', 'n', 'p', 'u... | 833c58b81ebec84dc24ef0507f8c75fe723d9f66 | 48856ead6ae023b2819ee63cb6ff97a0976a2cc3 |
python/cpython | python__cpython-123173 | # Source locations too broad for list comprehension iterable expression
# Bug report
Reported here: https://github.com/python/cpython/pull/120330#issuecomment-2295256627
```python
class Foo:
def __iter__(self):
assert False
a = [x for x in Foo()]
```
output (Python 3.12.5):
```python
Traceback (most re... | ec89620e5e147ba028a46dd695ef073a72000b84 | a4fd7aa4a6420cef1c22ec64eab54d8aea41cc57 |
python/cpython | python__cpython-125426 | # Make description of presentation types `f` and `e` in format spec more clear
Some time ago I was reading docs of [format specification mini-language](https://docs.python.org/3/library/string.html#format-specification-mini-language) and got a bit confused with the description for presentation type `f`. Because of my ... | cfc27bc50fe165330f2295f9ac0ad56ca5b0f31c | f1d33dbddd3496b062e1fbe024fb6d7b023a35f5 |
python/cpython | python__cpython-123131 | # Ambiguous invalid syntax error for a missing comma
# Bug report
### Bug description:
Trying to run the following code:
```python
dummy_call(
"dummy value"
foo="bar",
)
```
results in a `SyntaxError` that looks like:
```
File "...", line 2
"dummy value"
^^^
SyntaxError: invalid syntax. Perhaps ... | 48856ead6ae023b2819ee63cb6ff97a0976a2cc3 | b6d0a40a42fa17d087e502245b29cde46368ac07 |
python/cpython | python__cpython-123111 | # Incorrect note about _Bool type in the struct module docs
Note from table of [format characters](https://docs.python.org/3.14/library/struct.html#format-characters) says: "The '?' conversion code corresponds to the _Bool type defined by C99. If this type is not available, it is simulated using a char. In standard mo... | b0f462d4c808d6fb1d381bba4932acd8309c1f3b | 63603bca35798c166e1b8e0be76aef69217f8b1b |
python/cpython | python__cpython-123511 | # Stable ABI: `Objects/bytesobject.c:122: PyBytes_FromStringAndSize: Assertion '_Py_IsImmortal(op)' failed.`
# Crash report
### What happened?
While testing `qiskit`, I've found another crash in the stable ABI with 3.13. I've confirmed it with CPython 3.13 as of 3ab8eafbd94b82fe73995e165bb0e6ff5d67cdab.
To reproduc... | f1a0d96f41db9dfa5d7f0b32e72f6f7301a86f91 | 22fdb8cf899d2dd29f2ac0bf61309af6809719fb |
python/cpython | python__cpython-123279 | # Make WeakSet safe against concurrent mutation across threads while iterating
# Bug report
Currently if a `WeakSet` is being iterated then it is not safe against concurrent additions of weakrefs by other threads, this leads to spurious `RuntimeError`s being raised as the underlying set might resize. The existing `_I... | 03f5abf15a20f6e623282a393bc2a0affac69bb0 | 6754566a51a5706e8c9da0094b892113311ba20c |
python/cpython | python__cpython-123088 | # ``test_unittest`` raises a ``DeprecationWarning``
# Bug report
### Bug description:
```python
eclips4@nixos ~/p/p/cpython (main) [SIGINT]> ./python -m test -q test_unittest
Using random seed: 315532800
0:00:00 load avg: 11.34 Run 1 test sequentially in a single process
/home/eclips4/programming/programming-languag... | e6d5ff55d0816d7f5eb45e49c810e936b09d2be7 | 35d8ac7cd7ed6cd3d84af721dce970da59bd5f68 |
python/cpython | python__cpython-123125 | # Remove `shutil.ExecError`
# Feature or enhancement
As of Python 3.5 / GH-64943 / a0934b2c1b939fdebee8dc18d49a0f6c52324773, `shutil.ExecError` exceptions are not raised in any circumstances. I propose that we delete the `ExecError` class and remove it from `__all__`.
<!-- gh-linked-prs -->
### Linked PRs
* gh-123... | 9dbd12375561a393eaec4b21ee4ac568a407cdb0 | f88c14d412522587085ae039ebe70b91d5b4e226 |
python/cpython | python__cpython-123092 | # `STORE_ATTR_WITH_HINT` has potential use-after-free
# Bug report
The order of operations in `STORE_ATTR_WITH_HINT` differs from the dictionary implementation in a way that is not safe:
https://github.com/python/cpython/blob/35d8ac7cd7ed6cd3d84af721dce970da59bd5f68/Python/bytecodes.c#L2235-L2242
It's not safe to c... | 297f2e093ec95800ae2184330b8408c875523467 | 4abc1c1456413f3d2692257545a33bb16b24f900 |
python/cpython | python__cpython-123077 | # configparser: unable to create unnamed section
Hi, just chiming in because I really love this new feature - however, I haven't managed to create a new INI file from scratch with an unnamed section yet. Is this possible? Here are my futile attempts with configparser 7.0.0 from backports:
```
Python 3.12.4 (tags/v... | be257c58152e9b960827362b11c9ef2223fd6267 | c15bfa9a71c8b7ce7ff6d8486f51aab566e8d81d |
python/cpython | python__cpython-123167 | # sys.monitoring branch for match case mapping to `None`
# Bug report
### Bug description:
With the code from [PR 122564](https://github.com/python/cpython/pull/122564), the destination of the "not taken" branch out of line 9 below, offset 46, maps (through `co_locations()`) to `None`, making it difficult (if not im... | bffed80230f2617de2ee02bd4bdded1024234dab | 77133f570dcad599e5b1199c39e999bfac959ae2 |
python/cpython | python__cpython-123047 | # Running ``Lib/test/test_weakref.py`` directly fails
# Bug report
### Bug description:
```python
eclips4@nixos ~/p/p/cpython (main) [2]> ./python Lib/test/test_weakref.py
..................................................................................F....F.................................................
======... | 786cac0c64dc156dfee817e87f15ae56b7e3ed00 | f84cce6f2588c6437d69a30856d7c4ba00b70ae0 |
python/cpython | python__cpython-123219 | # Unnecessary specialization failures of `LOAD_ATTR` and `STORE_ATTR` when attributes are shadowed by the object's class.
This applies to both instances and classes.
If an object and it's class both have attributes with the same name, this prevents specialization of access to the object's attribute.
However, in this... | 5d3201fe3f76aeba33e9e5956ba80a116e422bd0 | 90b6d0e0f8f07d7443695e14a18488cb499d3b4d |
python/cpython | python__cpython-124485 | # Quitting interactive help when started without call duplicates prompt
# Bug report
### Bug description:
When exiting interactive help after starting it without calling `help`, i.e. just typing `help` on the prompt and hitting enter, the next prompt is duplicated.
```none
Python 3.13.0b4 (main, Jul 18 2024, 09:41:... | 5a9afe23620aadea30013076d64686be8bf66f7e | d147e5e52cdb90496ae5fe85b3263cdfa9407a28 |
python/cpython | python__cpython-123052 | # Crash in `Py_Initialize` in non-main thread in free-threading build
`Py_Initialize` will crash if in the free-threaded build if it's not called from the main thread. Additionally, background threads may crash if the program allocates lots of memory in total (>=30 TiB, not necessarily at one time.)
The problem is ... | d061ffea7b408861d0a9d311e92c363da284971d | 40632b1f1da573f6d5e12453007474bcf70fba22 |
python/cpython | python__cpython-124467 | # test_time.TestStrftime4dyear.test_negative fails on Android Pixel 7
# Bug report
### Bug description:
This happens on the Pixel 7, but not on an emulator with the same API level (34). It may be caused by a bug in the underlying libc.
```
0:00:00 [1/1] test_time
test test_time failed -- Traceback (most recent call... | 0a3577bdfcb7132c92a3f7fb2ac231bc346383c0 | 365dffbaada421db8fdb684a84d1fb311b75ec40 |
python/cpython | python__cpython-124458 | # "disallowed arm64 system call" crashes on Android API levels 26-30
# Crash report
### What happened?
I've seen two versions of this crash. The first one mostly affects the asyncio tests, but also some others, e.g. `test_type_params`.
It happens both on an emulator (API levels 26-29) and a physical device (N... | c58c572a65eb5b93d054e779df289e975a0b9864 | 461c12b43870d51ea29eae7b0969b20565d50eb6 |
python/cpython | python__cpython-123007 | # enum.Flag __len__ missing "Added in version 3.11." in description
# Documentation
\_\_len\_\_ is missing the tag "Added in version 3.11." in its description.
Page: https://docs.python.org/3/library/enum.html#enum.Flag
<!-- gh-linked-prs -->
### Linked PRs
* gh-123007
* gh-123025
* gh-123026
<!-- /gh-linked-prs ... | 8e2dc7f380c7ffe6b0fe525b4d0558aaed9d7145 | f84754b70506f03bcbf9fb0265e327d05a1a4b51 |
python/cpython | python__cpython-123002 | # What’s the difference between “linesep” and “self.policy.linesep” in Lib.email.generator.Generator._write_headers?
https://github.com/python/cpython/blob/325e9b8ef400b86fb077aa40d5cb8cec6e4df7bb/Lib/email/generator.py#L230
Is there something special in the difference between `linesep` or `self.policy.linesep` or ... | 91ff700de28f3415cbe44f58ce84a2670b8c9f15 | 135dad9bd70bba5a7b432c744f2993476915cf07 |
python/cpython | python__cpython-123001 | # 3.13 Regression: `inspect.getsource()` returns incorrect source code
# Bug report
### Bug description:
In Python 3.13rc1, `inspect.getsource()` sometimes returns a "random" line for some objects.
For example, here's [`ssl.AlertDescription`](https://github.com/python/cpython/blob/v3.13.0rc1/Lib/ssl.py#L133-L1... | f88c14d412522587085ae039ebe70b91d5b4e226 | bb1d30336e83837d4191a016107fd501cd230328 |
python/cpython | python__cpython-123071 | # Spurious `-Warray-bounds` warning on GCC 11 in free-threaded build
After https://github.com/python/cpython/pull/122418, GCC 11+ now emits a (spurious) warning in optimized builds, but not debug builds. Clang does not issue a warning
```
Objects/longobject.c: In function ‘_PyLong_FromMedium’:
./Include/internal/... | 40632b1f1da573f6d5e12453007474bcf70fba22 | 44e458357fca05ca0ae2658d62c8c595b048b5ef |
python/cpython | python__cpython-122966 | # "test" GitHub Action workflow cannot be run manually
# Bug report
### Bug description:
With the inclusion of `build_msi` into the `Change detection` job of `test` workflow in #121778 it isn't possible to **manually** run the workflow anymore:
], the next prompt string should be ">>>", and it actually is so in 14 places in 4 files in _The Python Tutorial_ listed below. Yet in 9 other places in 4 files in ... | be90648fb2de58b148dcc7553a08ca646911baf2 | 1795d6cebaee07f30804d490fa90e3e516dfed79 |
python/cpython | python__cpython-122945 | # Re-work support of var-positional parameters in Argument Clinic
When fixing some bugs (#118814, #122688) I noticed also design problems in `_PyArg_UnpackKeywordsWithVararg()`.
* Its `vararg` parameter is always equal to `maxpos`, therefore it is redundant.
* Inserting a new tuple between values for positional an... | 1f777396f52a4cf7417f56097f10add8042295f4 | 09d6f5dc7824c74672add512619e978844ff8051 |
python/cpython | python__cpython-122913 | # urllib.request: ftp_open error handling code passes the wrong type of object to URLError
# Bug report
### Bug description:
There's a raw log of an example failure below. The problem is that ftp_open passes an exception object to URLError() when it should pass a string describing the error.
2024-08-07T17:16:46.312... | 77133f570dcad599e5b1199c39e999bfac959ae2 | 0480052ea1567d50e9772b836bc9f90bee11c2f7 |
python/cpython | python__cpython-122952 | # Compilation is broken with `HAVE_DYNAMIC_LOADING=0`
# Bug report
### Bug description:
When compiling for Wasm with `--disable-wasm-dynamic-linking`, we end up with `HAVE_DYNAMIC_LOADING=0`, which is currently broken with the following linking errors:
```
wasm-ld: error: Python/import.o: undefined symbol: _Py_ext_... | ee1b8ce26e700350e47a5f65201097121c41912e | 5f6851152254b4b9d70af4ae5aea3f20965cee28 |
python/cpython | python__cpython-122906 | # Malformed payload can lead to infinite loops in zipfile.Path
As reported in https://github.com/jaraco/zipp/issues/119, malformed paths in a zipfile can lead to undesirable behaviors (infinite loops) when traversed using zipfile.Path.
This issue tracks porting that fix to CPython.
<!-- gh-linked-prs -->
### Linke... | 9cd03263100ddb1657826cc4a71470786cab3932 | 4534068f22f07a8ab9871bc16abf03c478ee2532 |
python/cpython | python__cpython-122908 | # zipfile.Path.glob fails to match directories
As reported in https://github.com/jaraco/zipp/issues/121, the glob logic in `zipfile.Path` doesn't honor directories.
This issue tracks porting the fix here.
<!-- gh-linked-prs -->
### Linked PRs
* gh-122908
* gh-122926
* gh-122927
<!-- /gh-linked-prs -->
| 6aa35f3002dda25858d47e702e750e2871e42a7c | 9cd03263100ddb1657826cc4a71470786cab3932 |
python/cpython | python__cpython-122897 | # pathlib copy methods do not work across partitions
# Bug report
### Bug description:
On linux, after compiling latest `main` branch:
```
$ ./python
Python 3.14.0a0 (heads/main:5580f31c56e, Aug 10 2024, 22:50:58) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> impo... | c4ee4e756a311f03633723445299bde90eb7b79c | 127660bcdb28294c3817f955cabd85afb6828ffc |
python/cpython | python__cpython-122889 | # Incorrect argument type for `str()` crashes the interpreter
# Crash report
### What happened?
Using a byte string for the encoding parameter of `str()` results in a crash (instead of the expected TypeError):
```python
str(b"hello", b"ascii")
```
Here is the output I get on macos, 3.13.0b4:
```sh
% python
Python 3... | 53ebb6232a8ebc03827cf2251bfc67f1886ffd70 | 7c22ab5b38a1350c976ef35453d9b3ab7a294812 |
python/cpython | python__cpython-125310 | # Typo in the Python Tutorial
# Documentation
In "The Python Tutorial", [chapter "3. An Informal Introduction to Python"](https://docs.python.org/3/tutorial/introduction.html), section "3.1.2. Text", in the 3rd sentence of the 2nd paragraph under the 4th example, the following phrase contains a typo:
"End of lin... | 73801864d866c76ae26a120b9db9de21b08f8b50 | ccf17323c218a2fdcf7f4845d3eaa74ebddefa44 |
python/cpython | python__cpython-122884 | # Allow "-m json" instead of "-m json.tool"
# Feature or enhancement
### Proposal:
This is a feature proposal for allowing `python3 -m json` to work in addition to `python -m json.tool` and softly deprecating the use of `python3 -m json.tool`.
I [made a branch](https://github.com/python/cpython/compare/main...treyh... | 906b796af8388174cf493e23f29720eaed9fdf03 | db6f5e193315a3bbfa7b0b6644203bae3f76b638 |
python/cpython | python__cpython-122936 | # JIT does not build on the main branch
# Bug report
### Bug description:
Configuring with `--enable-experimental-jit` and then trying to build causes the following error (same as in #118343):
```
In file included from Python/optimizer_analysis.c:437:
Python/optimizer_cases.c.h: In function ‘optimize_uops’:
Python/... | 1795d6cebaee07f30804d490fa90e3e516dfed79 | 53ebb6232a8ebc03827cf2251bfc67f1886ffd70 |
python/cpython | python__cpython-122870 | # Hosted documentation has not been updated in over a week
# Documentation
I tried viewing the [Changelog](https://docs.python.org/3/whatsnew/changelog.html) to see what was included in the Python 3.12.5 release, and I noticed the page states "Last updated on Jul 31, 2024 (11:04 UTC)". I checked several other pages... | 0fd97e46c75bb3060485b796ca597b13af7e6bec | d3239976a8e66ae3e2f4314a6889d79cdc9a9625 |
python/cpython | python__cpython-124845 | # Running ``Lib/test/test_funcattrs.py`` directly fails
# Bug report
### Bug description:
```python
eclips4@nixos ~/p/p/cpython (tests_for_ast_opt) [1]> ./python Lib/test/test_funcattrs.py
............F.....................
======================================================================
FAIL: test___builtins_... | 8fbf10d6cfd9c69ffcc1f80fa0c5f33785197af7 | 6737333ac5777345d058271621ccb3c2d11dc81e |
python/cpython | python__cpython-122861 | # Dead code in ceval_macros.h and ceval_gil.c
The `_Py_atomic_load_relaxed_int32` macro is no longer used:
https://github.com/python/cpython/blob/d3239976a8e66ae3e2f4314a6889d79cdc9a9625/Python/ceval_macros.h#L378-L383
https://github.com/python/cpython/blob/d3239976a8e66ae3e2f4314a6889d79cdc9a9625/Python/ceval_g... | 1069190bad99701bf565497fa1e46575470bf237 | bc9d92c67933917b474e61905451c6408c68e71d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.