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-104116 | # `pathlib.WindowsPath.glob()` preserves case of literal pattern segments
When `pathlib.WindowsPath.glob()` evaluates a literal (non-wildcard) pattern segment, it returns paths using the case of the pattern segment, rather than the real filesystem case. This problem does not affect segments involving `*` or `**` wildc... | da1980afcb8820ffaa0574df735bc39b1a276a76 | 38dc3f28dde92b4fa6284a57f4e554991a3d9276 |
python/cpython | python__cpython-104113 | # we should not recommend using functools.cache on methods
# Documentation
Currently [the documentation for functools.cached_property](https://docs.python.org/3/library/functools.html#functools.cached_property) recommends stacking `@property` and `@functools.cache` decorators to "achieve an effect similar to" `func... | fa86a77589a06661fcebb806d36f3a7450e2aecf | 46361bb84332800bc3632688e6ef3b4dd4a48723 |
python/cpython | python__cpython-104110 | # Expose Py_NewInterpreterFromConfig() and PyInterpreterConfig in the Public C-API
This is part of the PEP 684 (per-interpreter GIL) implementation.
<!-- gh-linked-prs -->
### Linked PRs
* gh-104110
<!-- /gh-linked-prs -->
| 292076a9aa29aba1023340a0d24252a7b27a454e | de64e7561680fdc5358001e9488091e75d4174a3 |
python/cpython | python__cpython-104148 | # Add a Module Def Slot for Supporting Multiple Interpreters
PEP 489 is clear that extension modules implementing multi-phase init are expected to support use in multiple interpreters. However, there are two situations where that mandate isn't sufficient:
1. PEP 684 introduces a per-interpreter GIL, where there is... | c2627d6eea924daf80f374c18a5fd73ef61283fa | 3e818afb9b7c557aa633aeb3d5c4959750feeab0 |
python/cpython | python__cpython-104129 | # Python 3.11 is unbuildable with GCC on macOS (error: 'HAVE_MKFIFOAT_RUNTIME' undeclared, error: 'HAVE_MKNODAT_RUNTIME' undeclared)
<!--
If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not
the right place to seek help. Consider the following op... | e5b8b19d99861c73ab76ee0175a685acf6082d7e | ce871fdc3a02e8441ad73b13f9fced308a9d9ad1 |
python/cpython | python__cpython-104105 | # Optimize `pathlib.Path.glob()` by avoiding repeated calls to `os.path.normcase()`
As part of removing "flavour" classes in #31691, I changed pathlib's `glob()` implementation: previously it used `re.IGNORECASE` to implement case-insensitive matches, whereas after it called `os.path.normcase()` on the pattern and the... | 47770a1e91d096fd1c689eb0c78b0f9e76b43639 | 1f5384434dce013b5dcf7e7ea3ec5312d13bba72 |
python/cpython | python__cpython-104103 | # Optimize `pathlib.Path.glob()` handling of `../` pattern segments
These segments do not require a `stat()` call, as the selector's `_select_from()` method is called after we've established that the parent is a directory.
<!-- gh-linked-prs -->
### Linked PRs
* gh-104103
<!-- /gh-linked-prs -->
| 65a49c6553a27cc36eebb4b79f409c3cb4450d8c | 47770a1e91d096fd1c689eb0c78b0f9e76b43639 |
python/cpython | python__cpython-104137 | # Failed test_write_filtered_python_package test case in ./python -We -m test -v test_zipfile
<!--
If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not
the right place to seek help. Consider the following options instead:
- reading the Pyt... | 83751bbd142c23ca3f6af34ec617630dc3173b2a | 6ab463684b9d79880d98cd1f1406aa86af65985e |
python/cpython | python__cpython-104079 | # Performance of PyObject_HasAttrString
# Feature or enhancement
`PyObject_HasAttrString` is implemented in terms of `PyObject_GetAttrString` / `PyErr_Clear`.
for non-existing attributes, there's significant overhead from creating an error only to clear it later.
this can be optimized by implementing it in terms ... | 8d34031068ece75667260f6526d3165efe34e054 | fdb3ef8c0f94c7e55870a585dc6499aca46f9f90 |
python/cpython | python__cpython-104063 | # Performance of attribute lookup for module objects
# Feature or enhancement
Similar to gh-92216 (for type objects) - attribute lookup on module objects for non-existing attributes is significantly slower compared to existing attributes, as well as non-existing attributes on types and instances.
microbenchmark ... | fdcb49c36b2ed8347d8d9f2dcd7052cc90207beb | c9ecd3ee75b472bb0a7538e0288c5cfea146da83 |
python/cpython | python__cpython-104062 | # Add SO_BINDTOIFINDEX constant to socket module
# Feature or enhancement
Since Linux 5.0 socket option `SO_BINDTOIFINDEX` is available to avoid a race condition between `SO_BINDTODEVICE` and network interface renaming. Add this constant to `Modules/socketmodule.c` if available.
# Pitch
I will shamelessly ste... | e1fdc3c323bd605f92622b7ee18805885ff0bb4e | 142502ea8d26b17732009b6e981e630c342054f7 |
python/cpython | python__cpython-104059 | # Some test modules fail when run as a script
```python
C:\Users\KIRILL-1\CLionProjects\cpython> ./python Lib/test/test_module.py
Running Debug|x64 interpreter...
.....................F..............
======================================================================
FAIL: test_module_repr_with_full_loader (_... | d448fcb0323bf00cb4ff4a1e65e8424a73b5f0d4 | e665563f8301d0db5cb0847d75fc879f074aa100 |
python/cpython | python__cpython-104052 | # crash in ./python.exe -We -m test -v test_xxtestfuzz
```
% ./python.exe -We -m test -v test_xxtestfuzz
Raised RLIMIT_NOFILE: 256 -> 1024
== CPython 3.12.0a7+ (heads/main:2d526cd32f, May 1 2023, 19:02:26) [Clang 14.0.3 (clang-1403.0.22.14.1)]
== macOS-13.3.1-x86_64-i386-64bit little-endian
== Python build: debug... | 81fc135f263e9ec5df3d967290b9665d7e100c7f | 163034515a81f137d1dd7d289dc048eb0f1cd424 |
python/cpython | python__cpython-104421 | # Add type annotations to clinic.py
# Feature or enhancement
Gradually add type hints to clinic.py.
# Pitch
Adding type hints to clinic.py will make it easier to debug, fix bugs, do code review, add new features, and triage. IMO, the churn is worth the effort in the long run.
# Previous discussion
Since... | 9d41f83c58e6dc2fc6eb4b91f803551850b0adeb | a6bcc8fb92ffb75bb1907cc568ba9fff516979c3 |
python/cpython | python__cpython-104067 | # python 3.11 http.server internal path disclosure
# Bug report
Description
---
Python http.server will disclose the full path where the http server is running when certains URL encoded values are sent as parameters. This was tested on a linux and windows machine. This was initially reported to security@ but I wa... | c7c3a60c88de61a79ded9fdaf6bc6a29da4efb9a | 292076a9aa29aba1023340a0d24252a7b27a454e |
python/cpython | python__cpython-104037 | # Running test_typing file directly fails
```python
C:\Users\KIRILL-1\CLionProjects\cpython> ./python Lib/test/test_typing.py
Running Debug|x64 interpreter...
.............................F....................................................................................................
............................ | 4181d078fc945313568eb39965cb9190881606b5 | 59c27fa5cb95e2d608747a50fc675bbe2fc96beb |
python/cpython | python__cpython-104041 | # Frozen dataclasses with slots cannot override __getstate__ or __setstate__
You are supposed to be able to override how `pickle` pickles an object with `__getstate__` and `__setstate__`. However, these methods [are ignored](https://stackoverflow.com/questions/76143398/pickle-ignores-getstate-on-frozen-dataclasses-wit... | 99aab610622fc4b4c4fe56b77c0760cf77066a53 | e1476942525ae847875dab55541bef4a8a99dd3d |
python/cpython | python__cpython-104030 | # Reduce redundant object creation while calling callback function from gc
https://github.com/python/cpython/blob/4b27972f5fe816d3616f97f8643d8ad922473ab5/Modules/gcmodule.c#L1391-L1402
The phase object can be created earlier with one-time creation and it can be replaced with vectorcall either.
From my microbenchm... | e1476942525ae847875dab55541bef4a8a99dd3d | 4181d078fc945313568eb39965cb9190881606b5 |
python/cpython | python__cpython-104033 | # "z" format specifier is treated differently in unicode and bytes
Hello up there. I've hit a discrepancy in how `z` flags is handled by `%` in unicode and bytes:
- for unicode `%` rejects it as "unsupported format character" according to original discussion in https://github.com/python/cpython/issues/90153 (= [BPO... | 69621d1b09c996e43a1e13d2fa4c317d3dd4d738 | c53547c907371be53c8016145d73ba4ea0a22756 |
python/cpython | python__cpython-104047 | # Out-of-bounds write in AST parser
# Crash report
Reported by OSS-Fuzz (issue 58510).
Reproducer:
```python
import ast
ast.parse(bytes([
0x46, 0x22, 0x76, 0x76, 0x3a, 0x6f, 0x72, 0x3a, 0x2d, 0x7b, 0x22, 0x7b,
0x22, 0x46, 0x22, 0x76, 0x3a, 0x2d, 0x7b, 0x22, 0x7b, 0x22, 0x46, 0x22,
0x77, 0x72, 0x3a,... | 5078eedc5b18f0d208af6e30f60b33419132d1b6 | 2d526cd32fe8b286aae38956648e508070729f8f |
python/cpython | python__cpython-104017 | # Running test_dataclasses file directly fails
# Bug report
Running `./python Lib/test/test_dataclasses.py` gives me these test fails:
```pytb
[root@codespaces-44977f cpython]# ./python Lib/test/test_dataclasses.py
..................................................................................................... | 654d44b3a4d3ee4d92b690668aa5189acf4f9d8f | 7d3931e94a76491111a6e391e111cb066236cff4 |
python/cpython | python__cpython-104014 | # `test_calendar` fails on Azure Pipelines
The newly added test `test_calendar.CalendarTestCase.test_deprecation_warning` (added in https://github.com/python/cpython/commit/84e7d0f0c7f9a44d81be2d705ed4d401a6505356) has been consistently failing on Azure Pipelines over the past day. Example: https://dev.azure.com/Pytho... | 7d3931e94a76491111a6e391e111cb066236cff4 | f186557dc3e77495ba65b9b7e492ab6ddb7cecc3 |
python/cpython | python__cpython-104013 | # typing: Document get_origin and get_args separately
Currently `get_args` and `get_origin` share the same documentation paragraph:
<img width="904" alt="Screen Shot 2023-04-30 at 6 58 36 AM" src="https://user-images.githubusercontent.com/906600/235356943-27853a8c-384b-4585-8047-1b6487effac3.png">
This makes it ... | a7a2dbbf72aceef61bfb50901bfa39bfb8d6d229 | ce8d3db25660b029fa589a2072f4daf2a8723c50 |
python/cpython | python__cpython-104004 | # Implement PEP 702: Marking deprecations using the type system
PEP-702 is still under consideration by the Steering Council. I'm opening a PR now with a draft implementation, so we can get it merged quickly if the SC approves the PEP in time for the 3.12 cutoff.
<!-- gh-linked-prs -->
### Linked PRs
* gh-104004
<!--... | d4a6229afe10d7e5a9a59bf9472f36d7698988db | 403886942376210662610627b01fea6acd77d331 |
python/cpython | python__cpython-103990 | # segfault in mmap object when using __index__ method that closes the mmap
The following (artificial) code segfaults CPython (I tried a bunch of versions, including git main) on my x86 Ubuntu Linux 22.10:
```python
import mmap
with open("abcds", "w+") as f:
f.write("foobar")
f.flush()
class X(o... | ceaa4c3476ac49b5b31954fec53796c7a3b40349 | 3bc94e678f2961eafc9d665898d73afc6204d314 |
python/cpython | python__cpython-103979 | # 'class' parameter name in headers breaks building C++ extensions
See https://github.com/python/cpython/pull/103809#issuecomment-1526680458
<!-- gh-linked-prs -->
### Linked PRs
* gh-103979
<!-- /gh-linked-prs -->
| ebf97c50f25d61e15671a4658f5718f214c35a98 | 83aa496f81f86b46caf249a8ff7e168e6b27622d |
python/cpython | python__cpython-103981 | # Move compiled regular expressions in platform.py into cached methods
In `platform.py` there are several regular expressions compiled during import that might not be used at all. The regular expressions are only called once at most, since they are called from without cached metods. We can eliminate the cost of compi... | f186557dc3e77495ba65b9b7e492ab6ddb7cecc3 | ed95e8cbd4cbc813666c7ce7760257cc0f169d03 |
python/cpython | python__cpython-103980 | # Incorrect locations for code following `case` blocks
# Bug report
In the following example, the debugger hits a breakpoint that is set in the `aVariable = ...` line, which is in an if-statement whose condition is `False` and which should therefore not be executed. When I run the example with coverage (under PyCha... | 79b9db9295a5a1607a0b4b10a8b4b72567eaf1ef | 689723a4abdc1e61a9f71db8ff40886ae1b1704d |
python/cpython | python__cpython-103972 | # PyType_FromSpec refuses to create classes with tp_new
As reported in #60074, since `PyType_FromMetaclass` was added, other functions from the `PyType_FromSpec` family refuse to create classes whose metaclass has a non-default `tp_new`. IMO this is the correct default behaviour -- we don't have the arguments to call ... | 524a7f77fd8244835e382f076dd4a76404580bb3 | 423d7faeb37b6c13b3ebbf9255165fefc651983e |
python/cpython | python__cpython-104029 | # dis: Show names of intrinsics
For `CALL_INTRINSIC_*` opcodes, `dis` currently just shows the number, which makes it hard to figure out what the code actually does:
```
2 LOAD_CONST 0 ('T')
4 CALL_INTRINSIC_1 7
```
It would be nice if this instead said
```... | 872cbc613245db7a1fc5e6656ed0135d2e115f50 | 65a49c6553a27cc36eebb4b79f409c3cb4450d8c |
python/cpython | python__cpython-103983 | # Documentation: dark theme & images
# Documentation
Starting from version 3.12, the Docs now have a dark theme. However, this feature does not affect the images. As an example, please visit https://docs.python.org/3.12/library/pathlib.html.
The page contains an image of an inheritance tree. In the dark theme, the... | 13ac1766bca7969a6c142c9176db901dd29c3519 | b8f7ab5783b370004757af5a4c6e70c63dc5fe7a |
python/cpython | python__cpython-103958 | # `trace`: line tracing output lacks newlines if source lines are not available
`trace` doesn't print newline character when handling line event if it can't fetch source line that corresponds to a current frame, e. g. in case of frozen modules (or in any other case when `frame.f_code.co_filename` points to a non-exist... | 7c87ce777b3fd9055b118a58ec8614901ecb45e9 | da090f1658e72485b201507653f6d673f3e39c86 |
python/cpython | python__cpython-126264 | # Fast attribute access for module subclasses
# Feature or enhancement
There is a specialisation that allows for fast attribute access on the module type, and only the module type, since it is guarded by `PyModule_CheckExact()`. This specialisation could be enabled for module subclasses.
# Pitch
There are occ... | d9e251223e8314ca726fc0be8b834362184b0aad | 3fecbe9255391be1ac3c3b52dfe0254ee5c665bd |
python/cpython | python__cpython-103949 | # crash in "./python.exe -We -m test -v test_datetime -m test_folds"
Running on a Mac:
```
% ./python.exe -We -m test -v test_datetime -m test_folds
Raised RLIMIT_NOFILE: 256 -> 1024
== CPython 3.12.0a7+ (heads/main:44b5c21f41, Apr 27 2023, 20:09:36) [Clang 14.0.3 (clang-1403.0.22.14.1)]
== macOS-13.3.1-x86_64... | 689723a4abdc1e61a9f71db8ff40886ae1b1704d | ebf97c50f25d61e15671a4658f5718f214c35a98 |
python/cpython | python__cpython-103947 | # trace.__main__ does not use io.open_code
When used as an entry point, the `trace` module opens code files without using `io.open_code`:
https://github.com/python/cpython/blob/main/Lib/trace.py#L719
This should use the `io.open_code` method instead of `open(..., 'rb')`.
<!-- gh-linked-prs -->
### Linked PRs
*... | d50f01ad0a965c6d41e24ef77be0fe643efa1bfd | bf0b8a9f8d647515170cbdf3b6a8c0f44e0f37b3 |
python/cpython | python__cpython-104642 | # Document PEP 695
We should document PEP-695 for Python 3.12 (issue #103763, PR #103764 for implementation). I am leaving docs out of the PR to avoid complicating an already huge PR with a tight deadline, but let's start thinking about what we need to document:
- [x] New AST nodes in `ast.rst`
- [x] Language refe... | 060277d96bf4ba86df8e4d65831a8cbdfeb51fc5 | 95f1b1fef777254a45559c0348e80185df3634ff |
python/cpython | python__cpython-103904 | # Test documentation with the oldest supported Sphinx version
As we've discussed at various points recently, it would be of some use to have an automatic test that the minimum Sphinx version that we advertise in ``Doc/conf.py`` actually works. See PR for a new GitHub Actions job to test this on all documentation chang... | 44b5c21f4124f9fa1312fada313c80c6abfa6d49 | 0b7fd8ffc5df187edf8b5d926cee359924462df5 |
python/cpython | python__cpython-103900 | # Provide a hint when accidentally calling a module
This is sort of inspired by [PEP 713](https://peps.python.org/pep-0713), but I think it's worth doing whether that PEP is accepted or not.
When somebody attempts to call a module, we can provide a more helpful `TypeError` message than `'module' object is not calla... | 7d35c3121ade679dd6e8b4a0bac7b3702aee6921 | f5c38382f9c40f0017cef086896a8160e313ac9e |
python/cpython | python__cpython-103897 | # Issues when showing broken `Exception.__notes__`
# Bug report
When [notes on an exception](https://docs.python.org/3/library/exceptions.html#BaseException.__notes__) cannot be shown because the `repr` and `str` raise exceptions, a `<note str() failed>` message is shown instead. In the case where `exception.__note... | 487f55d5801a9ae7d79d37e259e8c377c9acd39b | 93107aa2a49a9354ffb10b3cd263dc3e99ebdeff |
python/cpython | python__cpython-104179 | # Improve `builtins.__doc__`
```pycon
>>> import builtins
>>> print(builtins.__doc__)
Built-in functions, exceptions, and other objects.
Noteworthy: None is the `nil' object; Ellipsis represents `...' in slices.
>>>
```
A few possible improvements:
- `None` is not actually in the builtins module, as it's ... | b35711d17a90251bdd57d255090e07daafe89f6c | 4ee2068c34bd45eddba7f6a8ee83f62d5b6932fc |
python/cpython | python__cpython-103889 | # Running the Docs workflow via workflow_dispatch always fails
Our Docs workflow file allows people to manually trigger the workflow on arbitrary branches in their GitHub fork of CPython:
https://github.com/python/cpython/blob/6c4124d11ab731f3774e3454ded33df089bd317e/.github/workflows/doc.yml#L1-L4
This is a use... | 842daa57cf93280dfb3430061007b7d54d3c1353 | bb8aa7a2b41ad7649d66909e5266fcee039e63ed |
python/cpython | python__cpython-103913 | # Python/C API "PyUnicode_FromObject" is listed in the "Deprecated " section
In the documentation of Python 3.11 (or earlier), the Python/C API "PyUnicode_FromObject" is listed in the "Deprecated Py_UNICODE APIs" section, which is marked to be removed in version 3.12:
https://docs.python.org/3.11/c-api/unicode.html... | ce2383ec6665850a1bdffad388876481b6f3205f | 1d99e9e46e9b517532fea11befe2e6d0043850bd |
python/cpython | python__cpython-103916 | # Broken test in test_genericalias
The test at https://github.com/python/cpython/blob/1c0a9c5a1c84bc334f2bde9d45676f19d9632823/Lib/test/test_genericalias.py#L315 has multiple statements in one `with self.assertRaises` block. This is bad, because the test will pass if only one of them raises. Presumably, we want a sepa... | dff8e5dc8d0758d1f9c55fdef308e44aefebe1a2 | ce2383ec6665850a1bdffad388876481b6f3205f |
python/cpython | python__cpython-103882 | # Numerous refleaks on main
https://buildbot.python.org/all/#/release_status shows that the refleak buildbots are failing on current main. Example output on https://buildbot.python.org/all/#/builders/75/builds/745/steps/5/logs/warnings__111_.
Failing tests:
<details>
```
test_functools leaked [1, 1, 2] refer... | 6c4124d11ab731f3774e3454ded33df089bd317e | 1c0a9c5a1c84bc334f2bde9d45676f19d9632823 |
python/cpython | python__cpython-103876 | # Use char and latin1 singletons in deepfreeze
# Feature or enhancement
Since https://github.com/python/cpython/pull/32152, deepfreeze will try to use static string singletons if possible.
But chars and latin1 singletons are not used. Here I propose to reuse them as well.
# Pitch
-
# Previous discussion
... | 214e5684c274f359d4cc34381f65e9f1a9952802 | 438b811761da124b949265d233f9fd9a74d7dd3f |
python/cpython | python__cpython-103873 | # Upgrade the bundled version of pip to 23.1.2
# Feature or enhancement
This is the latest pip release.
# Pitch
This ensures that users who install newest release of Python get the newest version of pip.
<!-- gh-linked-prs -->
### Linked PRs
* gh-103873
* gh-103874
<!-- /gh-linked-prs -->
| 438b811761da124b949265d233f9fd9a74d7dd3f | 2763994be38e388c321a6807264c694dbf1dafcb |
python/cpython | python__cpython-103866 | # LOAD_SUPER_ATTR doesn't match monitoring behavior of the opcodes it replaces
The `LOAD_SUPER_ATTR` super-instruction optimization doesn't correctly match the PEP 669 monitoring events that would be fired by the call to `super()` followed by attribute load that it replaces. This should be fixed.
<!-- gh-linked-prs -... | f40890b124a330b589c8093127be1274e15dbd7f | febcc6ccfb0726dab588e64b68d91abb37db1939 |
python/cpython | python__cpython-103863 | # Writing a small file into a ZipFile while forcing zip64 extensions results in an incorrect zip file
# Bug report
When forcing a small file to be added to a `zipfile.Zipfile` object with zip64 extensions when it doesn't need it, a Zip64 extra record is added to the resulting file, but the minimum version and files... | 798bcaa1eb01de7db9ff1881a3088603ad09b096 | 85ec192ac4b000d4e47df6123b65eacbd1fdccfa |
python/cpython | python__cpython-103858 | # Deprecate `utcnow` and `utcfromtimestamp`
# Feature or enhancement
Previously, we have [documented that `utcnow` and `utcfromtimestamp` should not be used](https://github.com/python/cpython/issues/81669), but we didn't go so far as to actually deprecate them, and I wrote a whole article about [how you shouldn't u... | 0b7fd8ffc5df187edf8b5d926cee359924462df5 | a5308e188b810e5cc69c1570bdc9b21ed6c87805 |
python/cpython | python__cpython-103849 | # [CVE-2024-11168] urlparse incorrectly retrieves IPv4 and regular name hosts from inside of brackets
# Background
RFC 3986 defines a host as follows
```
host = IP-literal / IPv4address / reg-name
```
Where
```
IP-literal = "[" ( IPv6address / IPvFuture ) "]"
reg-name = *( unreserved / pct-encoded / sub-del... | 29f348e232e82938ba2165843c448c2b291504c5 | 2c863b3871c6127a80aa7229033219f1cdcc8711 |
python/cpython | python__cpython-103851 | # Ref tests failure on test_monitoring
Tested on cef542ca57, GCC 11.3 Ubuntu 22.04
```
./python -m test test_monitoring -R :
```
<details><summary>Error Log</summary>
<p>
```
======================================================================
FAIL: test_c_call (test.test_monitoring.TestLineAndInstruc... | bcea36f8db9ad4fd542b38997e065987e829cb9f | 0a5cd984b215f28d3c205eadf0daf201b3388c90 |
python/cpython | python__cpython-103842 | # TIP 538 prevents building Tkinter against Tcl 8.7 built with bundled libtommath
<!--
If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not
the right place to seek help. Consider the following options instead:
- reading the Python tutorial: ... | 625887e6df5dbebe48be172b424ba519e2ba2ddc | 486bc8e03019b8edc3cbfc6e64db96d65dbe13b6 |
python/cpython | python__cpython-103825 | # Fix unused variable warning
https://github.com/python/cpython/pull/102343 introduced a variable used only in the assert macro, causing unused variable warnings in release mode.
<!-- gh-linked-prs -->
### Linked PRs
* gh-103825
<!-- /gh-linked-prs -->
| 0acea96dad622cba41bf1e9ee25d87658579ba88 | d8627999d85cc5b000dbe17180250d919f8510ad |
python/cpython | python__cpython-103993 | # Found Heap-use-after-free errors and SEGV in Python
# Your environment
- CPython versions tested on: 3.12.0 alpha 7
- Operating system and architecture: ubuntu20.04.1,x86_64
- Compiler flags: clang with ASAN and UBSAN instrument
# Bug description
The AddressSanitizer (ASAN) tool has detected multiple heap-u... | d5a97074d24cd14cb2a35a2b1ad3074863cde264 | 99aab610622fc4b4c4fe56b77c0760cf77066a53 |
python/cpython | python__cpython-103827 | # Return newly added Enum constants for month and days in calendar module
# Pitch
As discussed with @ethanfurman in one of my PR, I am going to create a PR to change the return type of functions and methods which currently return ints from 0-7 and 1-12 to represent days and months to newly added enum attributes
... | 1f5384434dce013b5dcf7e7ea3ec5312d13bba72 | 587f2f018051049cf5d9de3e12ed5aa7644404dc |
python/cpython | python__cpython-103821 | # IDLE bindings for scrolling using buttons 4 and 5 should only apply to X11
<!--
If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not
the right place to seek help. Consider the following options instead:
- reading the Python tutorial: https... | d25d4ee60cc789a8b9c222859bb720ade1ab2e30 | 53339a0ef72fcfc15221792b117c4670b07a0b20 |
python/cpython | python__cpython-103811 | # Broken references in dataclasses docs
When building the `dataclasses` docs in nitpicky mode , there are some warnings for broken references. Confirmed that the links in the live [docs](https://docs.python.org/3/library/dataclasses.html) are also broken.
```
make SPHINXOPTS="-n --keep-going" html
/Users/omatou... | 0f23eda4b996dacd19dbe91bd47a30433bf236d2 | 8291ae31ddc2f935b8ec60f3d5f3825f78ccf244 |
python/cpython | python__cpython-103812 | # Adjust F541 linting issue on Lib/test module
# Feature or enhancement
After running [ruff](https://github.com/charliermarsh/ruff) in CPython, some linting and formatting errors were found.
This issue intends to fix the `F541 f-string without any placeholders` errors related to the Lib/test module.
# Pitch
... | 8291ae31ddc2f935b8ec60f3d5f3825f78ccf244 | df3173d28ef25a0f97d2cca8cf4e64e062a08d06 |
python/cpython | python__cpython-103806 | # Add missing tests to the dis module
Improve test coverage for the dis module i.e `cpython/lib/dis.py`, tests are in `cpython/Lib/tests/test_dis.py`. Missing tests include:
- `dis.disco`
- `dis.findlinestarts`
<!-- gh-linked-prs -->
### Linked PRs
* gh-103806
* gh-103901
<!-- /gh-linked-prs -->
| 86aa8a5e98e5742bb5bb6ab617f08b1679b33b55 | ef25febcf2ede92a03c5ea00a13e167e0b5cb274 |
python/cpython | python__cpython-103796 | # Adjust `Tools/wasm` linting and formatting issues found by `ruff`
# Feature or enhancement
After running [`ruff`](https://github.com/charliermarsh/ruff) in CPython, some linting and formatting errors were found.
This issue intends to fix those related to the `wasm` module under `Tools/wasm`.
# Pitch
In the... | 01be52e42eac468b6511b56ee60cd1b99baf3848 | d94b3a6f45a068b2d2e5a75127f3c69a652645da |
python/cpython | python__cpython-103767 | # Defer string formatting in asyncio Task creation
# Feature or enhancement
When an asyncio Task is created without passing in a `name` (a common case), the init method uses a global counter to generate a task name of the form `"Task-<counter>"`.
It is very common in applications that the task name is never read... | 85c7bf5bcec07beea6064976e6199195cd34329d | fbf3596c3edadd03b5a8c659e9f27a09e5d1a051 |
python/cpython | python__cpython-103792 | # contextlib.suppress does not support ExceptionGroups
Currently, `contextlib.suppress` does not successfully suppress exceptions that are wrapped within an `ExceptionGroup`.
In other words, this works:
```python
def raise_ve():
raise ValueError("ve")
with suppress(ValueError):
raise_ve()
```
whi... | 22bed58e531ce780d91f3364c5ace98fad28c2e8 | 19e4f757de8c7cf2b4b9b4cbb32e376d0e50d2d4 |
python/cpython | python__cpython-103782 | # asyncio unix events test doesn't restore mocked unix_events.can_use_pidfd
# Bug report
in `test_asyncio.test_unix_events.PolicyTest.test_get_default_child_watcher`, `unix_events.can_use_pidfd` is mocked within the test body, but never restored to the original function.
this doesn't cause test failures during r... | 518050ced18422fd00fadc1a81b0d942b98e2e5b | 04ea04807dc76955f56ad25a81a0947536343c09 |
python/cpython | python__cpython-103778 | # `SHELL=/bin/sh -e` can cause failures when `Makefile` re-runs `./configure`
# Bug report
Since the change in GH-100328 to make `SHELL=/bin/sh -e` rather than just `/bin/sh`, `./configure` can fail in some cases when re-run by the `config.status` recipe in `Makefile`.
# Your environment
- Any environment where `./... | ed948e01bb68e3f026f38a7e43241d850ee1bfb5 | 6751a4af9512d4a6d65b5eedd60ff9923c519ad2 |
python/cpython | python__cpython-103769 | # Fix 'Warning: py:class reference target not found: ModuleSpec'
Follow-up from https://github.com/python/cpython/pull/103701#issuecomment-1518916047
<!-- gh-linked-prs -->
### Linked PRs
* gh-103769
* gh-103797
* gh-103799
<!-- /gh-linked-prs -->
| d2745fe850d7b1959843c3fd3d284aa14956cd9e | 68f583658247ceced323d79e1cf775c91c53c019 |
python/cpython | python__cpython-103764 | # Implement PEP 695
We should implement PEP-695. Some discussion of the implementation is at https://github.com/erictraut/cpython/issues. I will open a draft PR momentarily.
TODO:
- [ ] Evaluate TypeAlias values
- [ ] Lazy evaluation for TypeVar bounds
- [ ] More tests
- [ ] Fix remaining tests in test_typing.p... | 24d8b88420b81fc60aeb0cbcacef1e72d633824a | fdafdc235e74f2f4fedc1f745bf8b90141daa162 |
python/cpython | python__cpython-103747 | # `types.UnionType` + `Literal` types are not tested together
`Literal` had some known problems when used with `typing.Union` and `types.UnionType`.
Example: https://github.com/python/cpython/issues/103592
I've covered `typing.Union`, see https://github.com/python/cpython/pull/103706
But, I forgot about `types.Un... | 3d29edaf0a5f2e12e7f72552f602c761ddaf0d13 | d2745fe850d7b1959843c3fd3d284aa14956cd9e |
python/cpython | python__cpython-103744 | # Allocating extra data after an object instance
# Feature or enhancement
Add an unstable (in PEP 689 sense) function that allocates memory for a GC object and allows the caller to specify the size of additional memory that should be allocated after the object. Similar to what could be done using `_PyObject_GC_Mall... | 87223f32aba872cfebde6fbe38673799eb79f248 | f6314b92dcfc8ca6ff3fd150814f85448db69165 |
python/cpython | python__cpython-110960 | # IDLE - Remove unneeded .keys for dict iteration
Issue #87179, item 6. At the moment, `ob.keys()` appears 16 times in idlelib. Sometimes 'ob' is a dict, in which case '.keys()' can be removed. Sometimes ob is not a dict, and possibly not an iterable, and '.keys()' returns an iterable other than a dict keys view. ... | baefbb21d91db2d950706737a6ebee9b2eff5c2d | 77dbd956090aac66e264d9d640f6adb6b0930b87 |
python/cpython | python__cpython-103736 | # Remove recognition of "procbody" Tcl value type
Ever since #36111, Tkinter has checked for Tcl values with the "procbody" type, presumably because it was (and still is) one of the registered types or listed in tclInt.h. But this type is not interesting to Tkinter: any values of this type are wrapped with `_tkinter.T... | d96ca41688b9c2a8d261c340ae98438ca41796d8 | 579100f6d75a27429e7f8de74935d7bc3a3e44e6 |
python/cpython | python__cpython-103732 | # Remove `#ifdef TCL_WIDE_INT_TYPE` usage
In Tcl 8.4 and later, tcl.h has always provided `TCL_WIDE_INT_TYPE`, `Tcl_WideInt`, and `Tcl_WideUInt`. Since Tkinter requires 8.5.12, it is okay for `AsObj()` to use `Tcl_WideInt` without checking if `TCL_WIDE_INT_TYPE` is defined. `Tcl_WideInt` is already used without simila... | 6e850c30bb7085c80a97982d00c9c20e7d23ff84 | ccd4253752ae2d84a5448281db1a1298ca8d8610 |
python/cpython | python__cpython-103775 | # Empty unclosed f-string does not directly raise a SyntaxError in the REPL
# Bug report
This is another bug introduced in https://github.com/python/cpython/commit/1ef61cf71a218c71860ff6aecf0fd51edb8b65dc. When typing an empty single-quoted unclosed f-string in the REPL, another line is added and input is expected,... | cb157a1a353675cb6f08bdae5d7aadd6b28bb0a9 | ab25c7e3112b24a4cd8cb626bbd924c57af0fe1c |
python/cpython | python__cpython-103728 | # ASAN false positives due to vfork() with GCC 9
Older versions of ASAN don't properly support `vfork()`. Python uses `vfork()` when available in `_posixsubprocess.c`. This can lead to false positive reports from ASAN. I believe this issue exists with GCC 9 (and older), but not GCC 10 (and newer). The CPython GitHub ... | 83305808000e03cbad31ac3e9ef65454fb409282 | c9134fb228860bbb641794b1d165a95a55b5c669 |
python/cpython | python__cpython-103725 | # Add test case to assert Type error if no arg as provided in os.register_at_fork
# Test case
Add test case to ensure os.register_at_fork returns type error if no arg is specified
```
>>> import os
>>> os.register_at_fork()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: At... | 7255bbd4a1841447a21c3eb74e4fd9e21818d833 | 82932b72cabb6a77bbf5465a0a9574f90773aadf |
python/cpython | python__cpython-103719 | # Not closing an f-string leads to a use-after-free
# Bug report
Not closing an f-string in the REPL or a file leads to a use-after-free. This had to do with how f-string buffers are updated when in need of reallocating more space for the tokenizer buffer and it was introduced in https://github.com/python/cpython/c... | 05b3ce7339b9ce44eec728e88e80ba1f125436ed | 5041c2ba6e9c992d1c54834481c9be64581c0235 |
python/cpython | python__cpython-103717 | # Add missing requires_fork decorator to test case in simple_subprocess
# Enhancement
`simple_subprocess` test in Lib/test/test_socketserver.py could use `test.support.requires_fork()` as it depends on fork functionality.
<!-- gh-linked-prs -->
### Linked PRs
* gh-103717
<!-- /gh-linked-prs -->
| 777bdff0ec4c21176ddf61e07bc75d170bc65d54 | 9c3442c0938127788fa59e4ceb80ae78b86fad1d |
python/cpython | python__cpython-103713 | # Length of type names in AttributeError are inconsistent
Some of them truncate the type name at 50 characters, some 100, and some 200. 50 is noticeably short enough that I actually do encounter truncations with nested modules.
It'd be good to make this minimally consistent by replacing all the 50s with 100s.
<!--... | 543009347e7cfcc495ca8553fab8d622dcfd18e3 | 59c522f9650c22dc986debce483b83a4ffc6dc0d |
python/cpython | python__cpython-103709 | # Make site-packages implementation configurable
# Enhancement
It is confusing for different implementations of python (eg pypy and rustpython) to specify correct layout of site-packages, whether they should include their own implementation (by making huge diffs in sysconfig.py) or use same as cpython's implementat... | f46987b8281148503568516c29a4a04a75aaba8d | cf34b7704be4c97d0479c04df0d9cd8fe210e5f4 |
python/cpython | python__cpython-103698 | # Add `__orig_bases__` to non-generic TypedDict
# Feature or enhancement
As discussed at the typing summit, non generic TypedDict's completely loose all inheritance information. Funny enough, _generic_ TypedDict's actually preserve it via `__orig_bases__` because Generic does that. So this just brings non-generic T... | 0056701aa370553636b676cc99e327137d1688c6 | e38bebb9ee805df6848f42845e71c8da8a821ad3 |
python/cpython | python__cpython-103694 | # Add convenience variables to `pdb`
# Feature or enhancement
Add convenience variables like `$foo` to `pdb`, which would be global and temporary. There is a similar feature in `gdb`.
# Pitch
Currently, if the user needs to store something temporarily, they need to use a real variable in the current frame, wh... | 0fc58c66bafbd20f02c206c801cf9ab939853164 | 524a7f77fd8244835e382f076dd4a76404580bb3 |
python/cpython | python__cpython-103686 | # Tk 8.7: TIP 577 breaks tkinter.Menu.index()
# Bug report
One effect of [TIP 577](https://core.tcl-lang.org/tips/doc/trunk/tip/577.md) is that as of Tk 8.7, the `index` command for menus will now return an empty string instead of `none`, leading to an error in `tkinter.Menu.index()`:
```
>>> m.index('none')
T... | f0ed293f6aec1c2ed22725301b77d6ccedc2d486 | bd2dca035af88694e25fb060f984fbbcda82bed8 |
python/cpython | python__cpython-103674 | # socketserver: Add missing ForkingUnixStreamServer and ForkingUnixDatagramServer servers
# Enhancement
This issue / PR addresses two missing servers from the `socketserver` module
## Current behaviour
socketserver has the following
| Protocol | Family | Simple | Forking | Threading ... | d94b3a6f45a068b2d2e5a75127f3c69a652645da | 209a0a76552c19088e74b0f27827b9214b6c2cf8 |
python/cpython | python__cpython-103671 | # IDLE - Update code with pyupgrade
Item 7 for #87179. In https://github.com/python/cpython/issues/87179#issuecomment-1093900180, Anthony Sottile suggestted running his program [pyupgrade](https://pypi.org/project/pyupgrade/), which automates code updates. It would have done some of the things already done and will ... | bd2dca035af88694e25fb060f984fbbcda82bed8 | 7255bbd4a1841447a21c3eb74e4fd9e21818d833 |
python/cpython | python__cpython-103662 | # importlib/test_metadata_api fails on Windows buildbots
:warning::warning::warning: Buildbot failure :warning::warning::warning:
------------------------------------------------------------------------
Hi! The buildbot **AMD64 Windows10 3.x** has failed when building commit 3e0fec7e07a71bdeeab7554e980110fbc47763b... | dc328d398d8f65ec6d2fa493e16ceee75f6d774a | a4967d9d5974562dc0b3d2fcb494483cce9b8122 |
python/cpython | python__cpython-103651 | # perf maps address format
# Bug report
As implemented by @pablogsal in #96123 we can now generate perf maps(which is awesome BTW).
Currently, perf maps are formatted this way:
```
0x58c5882 b py::<module>:/home/arthur/Projects/python-playground/dummy_script.py
0x58c588d b py::baz:/home/arthur/Projects/python-p... | 8d95012c95988dc517db6e09348aab996868699c | e8d77b03e08a4c7e7dde0830c5a12a0b41ff7c33 |
python/cpython | python__cpython-103642 | # Convert calendar constants to enums and add months
From [this discuss thread](https://discuss.python.org/t/define-constants-for-month-numbers-in-calendar-module/25999?u=stoneleaf):
>The `calendar` module already defines constants e.g. `MONDAY` (0), `TUESDAY` (1), etc. for the [days of the week] https://docs.python.... | b934f97850b7b2db30fa2b26720d58aac4783149 | 57f8f9a66d4d0b5e590f7746a58136b3b45b1336 |
python/cpython | python__cpython-104949 | # PurePosixPath no longer correctly parses PureWindowsPath
# Bug report
In `pathlib` prior to Python 3.12, passing a `PureWindowsPath` to a `PurePosixPath` resulted in the Windows separator (`\`) being converted to the POSIX separator (`/`). However, in the current main branch the backslashes are preserved in the `... | 328422ce6162eb18735a2c0de12f8a696be97d0c | ad0be361c9922a918c7c3eaf83e1d8f2b019279c |
python/cpython | python__cpython-103894 | # Implement PEP 692
PEP-692 was accepted, but without the syntax change. That means there's very little to do in CPython, but a few changes should be made:
- https://docs.python.org/3.12/library/typing.html#typing.Unpack should mention this new use for Unpack
- https://docs.python.org/3.12/whatsnew/3.12.html shoul... | dc3f97549a8fe4f7fea8d0326e394760b51caa6e | a3a5b4bb232ba29875147baa3b56a5524eece353 |
python/cpython | python__cpython-103618 | # Compiler warnings in _iomodule.c
I'm getting a compiler warning for `_iomodule.c`:
```console
./Modules/_io/_iomodule.c:649:15: warning: incompatible function pointer types initializing 'freefunc' (aka 'void (*)(void *)') with an expression of type 'void (PyObject *)' (aka 'void (struct _object *)') [-Wincompati... | ffdbfe197694cb6f2509b94859ccf3534daa6fd1 | 700ec657c80e78fb299963ffaa684c859ddb8f87 |
python/cpython | python__cpython-109472 | # Behavior change for opcode trace after PEP 669
Before PEP 669, the opcode trace is togglable after trace function being set. So something like
```python
import sys
def opcode_trace_func(frame, event, arg):
print(frame, event)
return opcode_trace_func
sys.settrace(opcode_trace_func)
sys._getframe... | e0afed7e276b6611a2142ec70a0440298d528305 | 2bc01cc0c72a3d91bdcce09886efa987a90396d9 |
python/cpython | python__cpython-17425 | # Cannot pause asyncio transport immediately
# Bug report
When creating a asyncio transport/protocol pair, one might want to call `transport.pause_reading()` immediately when `protocol.connection_made()` is called. This is currently not possible. The call to `pause_reading()` is ignored, and reading commences nonet... | 78942ecd9b1dbbd95e99cc298b0154fe126dac12 | dff8e5dc8d0758d1f9c55fdef308e44aefebe1a2 |
python/cpython | python__cpython-103628 | # Unhelpful error message from logging.config.FileConfig can be improved
# Feature or enhancement
If a configuration file does not exist, the error raised by `logging.config.fileConfig` doesn't say that the file doesn't exist, instead suggesting that the file has an invalid format. This should be improved so that t... | 152227b569c3a9b87fe0483706f704762ced6d75 | c5b670efd1e6dabc94b6308734d63f762480b80f |
python/cpython | python__cpython-103600 | # [Enum] attributes of mixed-in classes can be shadowed by other members
As mentioned in #101273 , when mixing data types into an enum, the data type's methods can be lost:
```python
from enum import StrEnum, auto
class Book(StrEnum):
author = auto()
title = auto()
isbn = auto()
Book.author
#... | 700ec657c80e78fb299963ffaa684c859ddb8f87 | 07804ce24c3103ee1bb141af31b9a1a0f92f5e43 |
python/cpython | python__cpython-103706 | # Incorrect deduplication of Enum values in `Union[Literal[1], Literal[SomeEnum.one]]`
This was fixed on 3.9 (by https://github.com/python/cpython/pull/23294 or followups). Here's a test / example:
```python
from enum import Enum
from typing import Literal, Union, get_args
class MyEnum(int, Enum):
foo =... | 5041c2ba6e9c992d1c54834481c9be64581c0235 | 777bdff0ec4c21176ddf61e07bc75d170bc65d54 |
python/cpython | python__cpython-103665 | # [ExceptionGroup] Inconsistent raise inside except*
<!--
If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not
the right place to seek help. Consider the following options instead:
- reading the Python tutorial: https://docs.python.org/3/tut... | 63842bd90793c693f56bd8aad710b5267d41cf6d | 78942ecd9b1dbbd95e99cc298b0154fe126dac12 |
python/cpython | python__cpython-103540 | # Isolate _multibytecodec
<!-- gh-linked-prs -->
### Linked PRs
* gh-103540
* gh-103588
* gh-103589
* gh-103868
* gh-103869
* gh-103870
<!-- /gh-linked-prs -->
| 217911ede5d52b02b2e3c9222439e1ea08545291 | ff3303e49c13495d8d9cf1dc0cf0624bbda1d3ae |
python/cpython | python__cpython-103586 | # Dangling references to argparse.REMAINDER
# Documentation
In #61252, `argparse.REMAINDER` was removed from [the nargs documentation](https://docs.python.org/3.12/library/argparse.html#nargs) but there are still two references to the feature, one in [the table at the top](https://docs.python.org/3.12/library/argpa... | f4d087964e3deaabc902a155efdf0e7f43f78d52 | e989e0b62aba9b487faf24d8694d28022d35a776 |
python/cpython | python__cpython-103581 | # python -m pdb <utf-8 encoding file.py> return UnicodeDecodeError on Windows 8.1/10 (code page 936)
how to replicate the issue
Python 3.11.3/3.11.2/3.11.1/3.11.0 (python-3.11.3-amd64.exe etc)
Microsoft Windows [Version 10.0.19044.2130] (Active code page: 936)
tmp.py
```py
#coding:utf-8
print("中文")
```
... | 31acfd78a0810f84898d36a8289e407d3754b823 | c9864121cba5e5366d8e023fa14be0eac504cc06 |
python/cpython | python__cpython-103560 | # Upgrade the bundled version of pip to 23.1.1
# Feature or enhancement
This is the latest pip release.
# Pitch
This ensures that users who install newest release of Python get the newest version of pip.
<!-- gh-linked-prs -->
### Linked PRs
* gh-103560
* gh-103752
<!-- /gh-linked-prs -->
| b2862950dc05d313b228f02a8efdd8c9c59a8ff4 | 6b58d419a1bd62ac94274d108d59980a3eb6f6e0 |
python/cpython | python__cpython-103570 | # Improve coverage of `argparse` module
Since none of currently active core-devs have deep expertise in `argparse`, but we still need to fix bugs in this module. The best way to start is to add more tests and increase the coverage of this module.
Right now it has a pretty solid coverage of 97%
<img width="676" alt... | 9efaff5fd31a55e3beaa1fa430058de36a145566 | 418befd75d4d0d1cba83d8b81e1a7bcc9a65be8e |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.