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-102870 | # Remove JUMP_IF_FALSE_OR_POP and JUMP_IF_TRUE_OR_POP
See https://github.com/faster-cpython/ideas/issues/567.
<!-- gh-linked-prs -->
### Linked PRs
* gh-102870
<!-- /gh-linked-prs -->
| 3468c768ce5e467799758ec70b840da08c3c1da9 | 04adf2df395ded81922c71360a5d66b597471e49 |
python/cpython | python__cpython-102855 | # PEP 701 – Syntactic formalization of f-strings
- [x] Changes in the C tokenizer
- [x] Categorize failing tests
- [x] Fix failing tests or modify/remove them as needed
- [x] Changes in Python tokenizer
<!-- gh-linked-prs -->
### Linked PRs
* gh-102855
* gh-103633
* gh-103634
* gh-104006
* gh-104323
* gh-1047... | 1ef61cf71a218c71860ff6aecf0fd51edb8b65dc | a6b07b5a345f7f54ee9f6d75e81d2fb55971b35c |
python/cpython | python__cpython-102842 | # Confused traceback while `floordiv` or `mod` happens between `Fraction` and `complex` objects
```python
from fractions import Fraction
a = Fraction(1, 2)
b = a // 1j
>
Traceback (most recent call last):
File "C:\Users\KIRILL-1\CLionProjects\cpython\example.py", line 5, in <module>
b = a // 1j
~... | 5319c66550a6d6c6698dea75c0a0ee005873ce61 | 597fad07f7bf709ac7084ac20aa3647995759b01 |
python/cpython | python__cpython-102863 | # Speedup math.log by removing AC stuff
In #64385 this functions was converted to the Argument Clinic. Unfortunately, the function signature was "corrupted", probably to prevent showing "magic number" 2.718281828459045 in the function docstring, and this has a noticeable speed impact (~2x regression). In the current... | d1a89ce5156cd4e1eff5823ec2200885c43e395e | 41ef502d740b96ca6333a2d0202df7cce4a84e7d |
python/cpython | python__cpython-103009 | # Documentation for `bisect` with keys
# Documentation
Missing documentation for keys in `bisect` functions' doc-strings.
I've also found the wording in the [official documentation](https://docs.python.org/3/library/bisect.html) to be a little confusing. I think it might be clearer to use an overloaded definitio... | 1fd603fad20187496619930e5b74aa7690425926 | 87adc63d66349566b6459f93be60861b9d37782f |
python/cpython | python__cpython-103339 | # IDLE - Remove use of deprecated sys.last_xyzs in stackviewer
#102778 deprecated sys.last_type/value/traceback in favor of sys.last_exc, added in 3.12. We cannot access system system-set sys.last_exc in 3.10 and 3.11, but we can set it from sys.last_value or sys.exec_info()[1] and nearly never set or otherwise acces... | 3ee921d84f06da9dfa8aa29e0d33778b9dbf8f23 | 68dfa496278aa21585eb4654d5f7ef13ef76cb50 |
python/cpython | python__cpython-102829 | # add option for error callback of to shutil.rmtree to accept exception rather than exc_info
shutil.rmtree accepts as ``onerror`` a callback to should expect an exc_info tuple. To move off this, I will add a new kwarg "onexc" which should expect just an exception object. ``onerror`` will continue to work for now, b... | d51a6dc28e1b2cd0353a78bd13f46e288fa39aa6 | 4d1f033986675b883b9ff14588ae6ff78fdde313 |
python/cpython | python__cpython-102824 | # Document that float // float returns a float
PEP 238 [states clearly](https://peps.python.org/pep-0238/#semantics-of-floor-division) that the result of `x // y` is a `float`, when `x` and `y` both have type `float`.
> For floating point inputs, the result is a float. For example:
>
> 3.5//2.0 == 1.0
>
... | b72251de930c8ec6893f1b3f6fdf1640cc17dfed | b2729e93e9d73503b1fda4ea4fecd77c58909091 |
python/cpython | python__cpython-104579 | # Duplicate frame in traceback of exception raised inside trace function
First appeared in e028ae99ecee671c0e8a3eabb829b5b2acfc4441.
Reproducer:
```python
import sys
def f():
pass
def trace(frame, event, arg):
raise ValueError()
sys.settrace(trace)
f()
```
Before 'bad' commit (3e43fac2503afe... | c26d03d5d6da94367c7f9cd93185616f2385db30 | 616fcad6e2e10b0d0252e7f3688e61c468c54e6e |
python/cpython | python__cpython-102811 | # Add docstrings to asyncio.Timeout
# Feature or enhancement
`asyncio.Timeout` doesn't have docstrings. (`asyncio.timeout` does though:) )
# Pitch
Adding docstrings would increase the usability of this class.
# Notes
I will open a PR for this shortly.
I envisage starting out copying from the docs: http... | 699cb20ae6fdef8b0f13d633cf4858465ef3469f | d51a6dc28e1b2cd0353a78bd13f46e288fa39aa6 |
python/cpython | python__cpython-102854 | # What to do with `Misc/gdbinit`?
Quoting: https://github.com/python/cpython/pull/101866#discussion_r1140997764
> Does this file have any tests? I suspect that most of the code in this file is wrong (as we have changed much of CPython since it was written).
Problems:
1. After https://github.com/python/cpython/p... | ef000eb3e2a8d0ecd51b6d44b390fefd820a61a6 | 094cf392f49d3c16fe798863717f6c8e0f3734bb |
python/cpython | python__cpython-102800 | # some usages of sys.exc_info can be replaced by more modern code
There are some obvious places where sys.exc_info() can be replaced by direct access to a captured exception (without needing any new features that could complicate backports.)
Need to avoid changing tests that are testing exc_info, like generator tes... | b3cc11a08e1e9121ddba3b9afb9fae032e86f449 | 72186aa637bc88cd5f5e234803af64acab25994c |
python/cpython | python__cpython-102798 | # Implement TODO in `test_ast.py`
In `test_ast.py` we have a old TODO:
https://github.com/python/cpython/blob/72186aa637bc88cd5f5e234803af64acab25994c/Lib/test/test_ast.py#L266-L267
How I understand, it says about code snippets in `exec_tests` and `eval_tests`.
So, I've decide to improve it.
<!-- gh-linked-prs -->... | b8fb369193029d10059bbb5f760092071f3a9f5f | a816cd67f43d9adb27ccdb6331e08c835247d1df |
python/cpython | python__cpython-102796 | # test_epoll.test_control_and_wait flakes from improper poll() usage
# Bug report
test_epoll.test_control_and_wait can flake. In the test we wait for events on two file descriptors. This is done in a single call to select.epoll's poll() function. However, it is valid for the OS to return only one event via poll() a... | c9ecd3ee75b472bb0a7538e0288c5cfea146da83 | 45398ad51220b63b8df08fb5551c6b736205daed |
python/cpython | python__cpython-102782 | # Cases generator: inserted #line directives are dependent on cwd
# Bug report
Python supports out-of-tree builds, e.g.:
```
> git clone git@github.com:python/cpython
> mkdir -p builds/dbg
> cd builds/dbg
> ../../cpython/configure --with-pydebug
> make -j
```
This is useful for e.g. keeping both debug a... | 174c4bfd0fee4622657a604af7a2e7d20a3f0dbc | 65fb7c4055f280caaa970939d16dd947e6df8a8d |
python/cpython | python__cpython-102815 | # Catching CancelledError requires use of task.uncancel()
<!--
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/... | 04adf2df395ded81922c71360a5d66b597471e49 | 1ca315538f2f9da6c7b86c4c46e76d454c1ec4b9 |
python/cpython | python__cpython-102779 | # Add sys.last_exc, deprecate sys.last_type, sys.last_value and sys.last_traceback
<!-- gh-linked-prs -->
### Linked PRs
* gh-102779
* gh-102825
* gh-103314
* gh-105190
* gh-105246
<!-- /gh-linked-prs -->
| e1e9bab0061e8d4bd7b94ed455f3bb7bf8633ae7 | 039714d00f147be4d018fa6aeaf174aad7e8fa32 |
python/cpython | python__cpython-103485 | # Improve performance of ntpath.isdir/isfile/exists/islink
These functions should use `GetFileAttributesW` for their fast paths, and the ones that traverse links can fall back to `stat` if a reparse point is found.
<!-- gh-linked-prs -->
### Linked PRs
* gh-103485
<!-- /gh-linked-prs -->
| b701dce340352e1a20c1776feaa368d4bba91128 | 8a0c7f1e402768c7e806e2472e0a493c1800851f |
python/cpython | python__cpython-102759 | # Function signature mismatch for `functools.reduce` between C implementation, Python implementation, and online documentaion
# Documentation
(A clear and concise description of the issue.)
The function signature mismatch for `functools.reduce`:
- C implementation:
```python
_initial_missing = obj... | 74f315edd01b4d6c6c99e50c03a90116820d8d47 | 0bb0d88e2d4e300946e399e088e2ff60de2ccf8c |
python/cpython | python__cpython-102756 | # Add PyErr_DisplayException(exc) as replacement for PyErr_Display(typ, exc, tb)
Create a single-arg version of PyErr_Display.
PyErr_Display is in the stable ABI but it is not documented. PyErr_DisplayException will therefore need to be in the stable ABI as well (and documented).
<!-- gh-linked-prs -->
### Li... | 3f9285a8c52bf776c364f0cf4aecdd8f514ac4e1 | 405739f9166592104a5b0b945de92e28415ae972 |
python/cpython | python__cpython-102749 | # Remove legacy code for generator based coroutines in `asyncio`
Generator based coroutines were long deprecated and removed and `asyncio` doesn't not supports it. There is some left over code for supporting it which can be removed now.
The first thing is this behavior of `asyncio.iscoroutine` which makes no sense... | adaed17341e649fabb0f522e9b4f5962fcdf1d48 | fbe82fdd777cead5d6e08ac0d1da19738c19bd81 |
python/cpython | python__cpython-136431 | # Clarify "system-wide" in docs for time.monotonic()
The documentation for [`time.monotonic()`](https://docs.python.org/dev/library/time.html#time.monotonic) currently states:
> Changed in version 3.5: The function is now always available and always system-wide.
I didn't know what system-wide meant, and so propo... | 9c4d28777526e9975b212d49fb0a530f773a3209 | 92b33c9590140263343c3e780bfc2ea1c1aded5c |
python/cpython | python__cpython-102739 | # remove register instruction related code from the cases generator script
Since we won't have register instructions in 3.12, we should remove this from the generator for now.
<!-- gh-linked-prs -->
### Linked PRs
* gh-102739
<!-- /gh-linked-prs -->
| 675b97a6ab483573f07ce6e0b79b0bc370ab76c9 | 0a22aa0528a4ff590854996b8854e9a79120987a |
python/cpython | python__cpython-102745 | # C-analyzer tool cannot parse `#line` directives
# Bug report
`#line` directives were added to `generated_cases.c.h` in https://github.com/python/cpython/commit/70185de1abfe428049a5c43d58fcb656b46db96c, but the C-analyzer tool cannot handle these directives. This caused the CI check to start failing on all PRs, e.... | 84e20c689a8b3b6cebfd50d044c62af5d0e7dec1 | adaed17341e649fabb0f522e9b4f5962fcdf1d48 |
python/cpython | python__cpython-102722 | # Improve coverage of `_collections_abc._CallableGenericAlias`
Right now several important implementation details of this type is not covered:
1. Pickle with `ParamSpec`
<img width="1254" alt="Снимок экрана 2023-03-15 в 12 55 15" src="https://user-images.githubusercontent.com/4660275/225277373-31b4b04e-a172-49d9... | fbe82fdd777cead5d6e08ac0d1da19738c19bd81 | b0ec6253c9cf1b22b87cd99f317dbaeb31263b20 |
python/cpython | python__cpython-102712 | # Warnings found by clang
During build python via clang-15, the below warnings were found:
```
/home/lge/rpmbuild/BUILD/Python-3.10.9/Parser/pegen.c:812:31: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
_PyPegen_clear_memo_statistics()
... | 7703def37e4fa7d25c3d23756de8f527daa4e165 | f4ed2c6ae5915329e49b9f94033ef182400e29fa |
python/cpython | python__cpython-102707 | # Typo in https://docs.python.org/3/tutorial/modules.html
# Documentation
> In “is prevents directories with a common name, such as string, unintentionally hiding valid modules that occur later on the module search path” s/ unintentionally/ from unintentionally/
Originally reported in the mailing list by Goldber... | 0a539b5db312d126ff45dd4aa6a53d40a292c512 | 152292b98fd52f8b3db252e5609d6a605a11cb57 |
python/cpython | python__cpython-102750 | # dict() resize failure
# Bug report
When running under python 3.11.1, 3.11.2 and 3.12.a6, the dict() data structure fails to resize past 357913941 elements. This worked last (in what I have available) under python 3.10.8 and I can find no documentation that limits the size of a dict to a finite size. The system has ... | 65fb7c4055f280caaa970939d16dd947e6df8a8d | 4f5774f648eafd1a7076ecf9af9629fb81baa363 |
python/cpython | python__cpython-103162 | # Allow for built-in modules to be submodules
# Bug report
If you statically link a namespaced extension (such as `numpy.core._multiarray_umath`) and add it to the inittab, it will not get loaded properly. In this case, the path to the extension is passed to the `BultinImporter.find_spec` method which causes it to ... | 5d08c3ff7d89ca11556f18663a372f6c12435504 | dca7d174f1dc3f9e67c7451a27bc92dc5a733008 |
python/cpython | python__cpython-102691 | # Update webbrowser to use Edge as fallback instead of IE
# Feature or enhancement
[webbrowser.py](https://github.com/python/cpython/blob/54060ae91da2df44b3f6e6c698694d40284687e9/Lib/webbrowser.py#L546) currently uses Internet Explorer as the fallback browser on Windows, if the user has no default browser, and no ... | 1c9f3391b916939e5ad18213e553f8d6bfbec25e | 2a03ed034edc6bb2db6fb972b2efe08db5145a28 |
python/cpython | python__cpython-103969 | # Make `dis.Instruction` more useful
I recently was [playing with bytecode instructions](https://github.com/faster-cpython/tools/tree/guidos-explorations/explore) and found that the `dis.Instruction` did *almost* what I needed, but not quite -- I ended up reimplementing it, mostly reinventing the wheel. I propose to i... | 18d16e93b6d4b7b10c5145890daa92b760fe962a | 845e593c4ec97dd9f73b50536c1e1e7ed10ceecd |
python/cpython | python__cpython-102685 | # Generate Lib/opcode.py from Python/bytecodes.c
This could also auto-generate Include/opcode.h, Include/internal/pycore_opcode.h and Python/opcode_targets.h, subsuming both Tools/build/generate_opcode_h.py and Python/makeopcodetargets.py -- although the simplest approach would probably be to just keep those tools and... | d77c48740f5cd17597693bd0d27e32db725fa3a0 | cdb21ba74d933e262bc1696b6ce78b50cb5a4443 |
python/cpython | python__cpython-102649 | # Use sumprod() to simplify, speed up, and improve accuracy of statistics functions
* Use sumprod() which is faster, simpler, and more accurate than rounding each multiplication before summation.
* For an additional speed-up and simplification, compute the (x_xi - bar) only once instead of multiple times.
* For Spea... | 457e4d1a516c2b83edeff2f255f4cd6e7b114feb | 61479d46848bc7a7f9b571b0b09c4a4b4436d839 |
python/cpython | python__cpython-102669 | # Add `#line` directives to generated_cases.c.h
It would be nice if compiler errors in Python/bytecodes.c actually pointed to the file you have to edit.
(Filing for @markshannon.)
<!-- gh-linked-prs -->
### Linked PRs
* gh-102669
<!-- /gh-linked-prs -->
| 70185de1abfe428049a5c43d58fcb656b46db96c | 61b9ff35cbda0cc59816951a17de073968fc25c6 |
python/cpython | python__cpython-102742 | # `random_combination_with_replacement` recipe has misleading docstring
# Documentation
The `random` module has four [recipes](https://docs.python.org/3/library/random.html#recipes) that are supposed to *"efficiently make random selections from the combinatoric iterators in the itertools module"*. And their docstri... | b0ec6253c9cf1b22b87cd99f317dbaeb31263b20 | a297d59609038ccfc3bdf6f350e8401f07b0a931 |
python/cpython | python__cpython-102651 | # Duplicate #include directives in multiple C files
These are examples of duplicate `#include` directives that, as far as I can see, do not cause any side effects and therefore can be freely removed (although I have doubts about few cases):
https://github.com/python/cpython/blob/634cb61909b1392f0eef3e749931777adb54f1... | 85ba8a3e03707092800cbf2a29d95e0b495e3cb7 | 2d370da5702f07d044f0e612df68172852b89f42 |
python/cpython | python__cpython-103898 | # Prompt text in sqlite3 CLI (new in 3.12) is Linux oriented and doesn't apply to Windows
# Bug report
The command line command `python3.12 -m sqlite3` gives a prompt stating "[...]Type ".help" for more information; type ".quit" or CTRL-D to quit."
But on Windows, the Unixism `CTRL-D` doesn't work (instead, and afte... | 8def5ef0160979c05a20f35b143d2314e639982b | 44b5c21f4124f9fa1312fada313c80c6abfa6d49 |
python/cpython | python__cpython-102630 | # Some supposedly invalid addresses in the documentation point toward malicious websites
## Describe the problem
I found in the documentation about concurrency some examples that have been "exploited" by malicious people:
in the [ThreadPoolExecutor Example](https://docs.python.org/3/library/concurrent.futures.html... | 61479d46848bc7a7f9b571b0b09c4a4b4436d839 | 392f2ad3cbf2e1f24656fe0410a9b65882257582 |
python/cpython | python__cpython-102637 | # Representation of ParamSpecs at runtime compared to Callable
I think a list representation is more consistent with the text of PEP 612 and the runtime representation of Callable. We should change the runtime repr of ParamSpec generics to be more like Callable, because right now they're inconsistent:
... | 2b5781d659ce3ffe03d4c1f46e4875e604cf2d88 | 8647ba4b639077e201751ae6dbd82e8bfcf80895 |
python/cpython | python__cpython-104244 | # Path.rglob performance issues in deeply nested directories compared to glob.glob(recursive=True)
# Bug report
Pathlib.rglob can be orders of magnitudes slower than `glob.glob(recursive=True)`
With a 1000-deep nested directory, `glob.glob` and `Path.glob` both took under 1 second. `Path.rglob` took close to 1.5... | c0ece3dc9791694e960952ba74070efaaa79a676 | 8d95012c95988dc517db6e09348aab996868699c |
python/cpython | python__cpython-102599 | # Remove special-casing from `FORMAT_VALUE` opcode
Right now there's a special case in handling this opcode:
https://github.com/python/cpython/blob/5ffdaf748d98da6065158534720f1996a45a0072/Python/bytecodes.c#L3060-L3073
It comes from older version of `ceval.c`:
https://github.com/python/cpython/blob/281078794... | 82eb9469e717e0047543732287a8342e646c2262 | 1a5a14183ec807ead1c6a46464540159124e5260 |
python/cpython | python__cpython-102596 | # `PyObject_Format` c-api function is not documented
# Documentation
I think it must be, for the following reasons:
1. It is a stable API that exists since python3
2. It is implementing a builtin magic method `__format__`
3. It is quite useful for others
4. It is quite simple
5. There are no plans to remove / ... | 910a64e3013bce821bfac75377cbe88bedf265de | 7f760c2fca3dc5f46a518f5b7622783039bc8b7b |
python/cpython | python__cpython-102635 | # Another invalid JSON in
# Documentation
When building the documentation for Python 3.10.10 (with Sphinx 4.2.0), the process build with this error:
```
[ 143s] Warning, treated as error:
[ 143s] /home/abuild/rpmbuild/BUILD/Python-3.10.10/Doc/howto/logging-cookbook.rst:341:Could not lex literal_block as "js... | d835b3f05de7e2d800138e5969eeb9656b0ed860 | 60bdc16b459cf8f7b359c7f87d8ae6c5928147a4 |
python/cpython | python__cpython-102573 | # [Enhancement] Speed up setting and deleting mutable attributes on non-dataclass subclasses of frozen dataclasses
# Feature or enhancement
The `dataclasses` library provides an easy way to create classes. The library will automatically generate relevant methods for the users.
Creating `dataclass`es with argumen... | ee6f8413a99d0ee4828e1c81911e203d3fff85d5 | 90f1d777177e28b6c7b8d9ba751550e373d61b0a |
python/cpython | python__cpython-118655 | # Add `-X importtime=2` for additional logging when an imported module is already loaded
# Feature or enhancement
Add special handling for `-X importtime=2` that provides additional output when already-loaded modules are imported. This will allow users to get a complete picture of runtime imports.
# Pitch
Whi... | c4bcc6a77864b42574ec663cde36f0cc10e97b46 | e6f8e0a035f4cbeffb331d90c295ab5894852c39 |
python/cpython | python__cpython-102565 | # Add docstrings to asyncio.TaskGroup
Python 3.11 added `asyncio.TaskGroup`[0]. We should encourage users of the language to use this class by adding docstrings and type-hinting, particularly since it has wide applications for users wishing to refactor their existing async code.
I'm happy to work on this but any su... | e94edab727d07bef851e0e1a345e18a453be863d | 5fce813d8e547d6508daa386b67f230105c3a174 |
python/cpython | python__cpython-102601 | # AttributeError in 3.11 on repr() of enum member if the enum has a non-Enum EnumType parent
# Bug report
In CPython 3.11.0 - 3.11.2 (but not 3.10.10), I get a weird AttributeError when repr() is called on an Enum member of a class that was defined using multiple inheritance. Minimal code to reproduce:
```
from... | bd063756b34003c1bc7cacf5b1bd90a409180fb6 | 16f6165b71e81b5e4d0be660ac64a9fce7dfd86c |
python/cpython | python__cpython-103149 | # [Enum] Exception being ignored in custom datatypes
```python
import enum
class Base:
def __init__(self, x):
print('In Base init')
raise ValueError("I don't like", x)
class MyEnum(Base, enum.Enum):
A = 'a'
def __init__(self, y):
print('In MyEnum init')
self.y ... | 2a4d8c0a9e88f45047da640ce5a92b304d2d39b1 | dfc4c95762f417e84dcb21dbbe6399ab7b7cef19 |
python/cpython | python__cpython-102614 | # `help` CLI shows a traceback when import failed
Currently, `help` will show a traceback when we type name of something which doesn't exist:
```python
help> 123
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<frozen _sitebuiltins>", line 103, in __call__
File "C:\Users\KIRI... | ba516e70c6d156dc59dede35b6fc3db0151780a5 | 03160630319ca26dcbbad65225da4248e54c45ec |
python/cpython | python__cpython-102538 | # It is possible for python_tzpath_context to fail in test_zoneinfo
# Bug report
[This code](https://github.com/python/cpython/blob/11a2c6ce516b24b2435cb627742a6c4df92d411c/Lib/test/test_zoneinfo/test_zoneinfo.py#L1544-L1555) started failing the `pylint` check on `backports.zoneinfo` recently:
```python
@static... | 64bde502cf89963bc7382b03ea9e1c0967d22e35 | 53dceb53ade15587b9cfd30c0a0942232517dee9 |
python/cpython | python__cpython-102544 | # Add `os.listdrives` on Windows
We don't currently have a way to get all the root directories on Windows, since `os.listdir('/')` doesn't contain everything.
I propose a very simple API:
```
>>> os.listdrives()
["C:\\", "D:\\", ...]
>>> os.listdrives(uuids=True)
["\\?\Volume{4c1b02c1-d990-11dc-99ae-806e6f6e... | cb35882773a3ffc7fe0671e64848f4c926a2d52f | 2999e02836f9112de6b17784eaca762fb87e71a9 |
python/cpython | python__cpython-102516 | # Unused imports in the `Lib/` directory
The [`pycln`](https://github.com/hadialqattan/pycln) tool has highlighted 34 files in the `Lib/` directory which appear to have unnecessary imports.
<!-- gh-linked-prs -->
### Linked PRs
* gh-102516
<!-- /gh-linked-prs -->
| 401d7a7f009ca2e282b1a0d1b880dc602afd39dc | 7d801f245e2021d19daff105ce722f22aa844391 |
python/cpython | python__cpython-118089 | # Add C implementation of os.path.splitroot()
# Feature or enhancement
Speed up `os.path.splitroot()` by implementing it in C.
# Pitch
[Per](https://github.com/python/cpython/pull/102454#discussion_r1128466021) @eryksun:
> I think `splitroot()` warrants a C implementation since it's a required step in our ... | 10bb90ed49a81a525b126ce8e4d8564c1616d0b3 | e38b43c213a8ab2ad9748bac2732af9b58c816ae |
python/cpython | python__cpython-102510 | # cpython3:fuzz_builtin_unicode: Use-of-uninitialized-value in maybe_small_long
There is a bug disclosed by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51574.
I can reproduce it by running `CC=clang ./configure --with-memory-sanitizer && make -j12`.
<!-- gh-linked-prs -->
### Linked PRs
* gh-10... | fc130c47daa715d60d8925c478a96d5083e47b6a | a1b679572e7156bc4299819e73235dc608d4a570 |
python/cpython | python__cpython-102531 | # Remove invisible pagebreak chars from the standard library
Following a discussion on a PR to clean up some unused vars in the email module: https://github.com/python/cpython/pull/102482,
there seemed to be a general feeling that we should remove invisible pagebreak characters (U+000C) from the standard library.
... | b097925858c6975c73e989226cf278cc382c0416 | 401d7a7f009ca2e282b1a0d1b880dc602afd39dc |
python/cpython | python__cpython-102521 | # Implement PEP 688: Making the buffer protocol accessible in Python
PEP-688 has just been accepted. I will use this issue to track its implementation in CPython.
<!-- gh-linked-prs -->
### Linked PRs
* gh-102521
* gh-102571
* gh-104174
* gh-104281
* gh-104288
* gh-104317
<!-- /gh-linked-prs -->
| 04f673327530f47f002e784459037231de478412 | b17d32c1142d16a5fea0c95bce185bf9be696491 |
python/cpython | python__cpython-102482 | # Clean up unused variables and imports in the email module
I propose cleaning up some unused vars/imports in the email module.
This is mostly just tidying up a few things / housekeeping.
PR: https://github.com/python/cpython/pull/102482
<!-- gh-linked-prs -->
### Linked PRs
* gh-102482
<!-- /gh-linked-prs... | 04ea04807dc76955f56ad25a81a0947536343c09 | 58b6be3791f55ceb550822ffd8664eca10fd89c4 |
python/cpython | python__cpython-102502 | # gh-101607 causes regression in third-party psutil package on macOS
As part of the cPython release process for macOS installers, besides the standard cPython test suite, we run a small set of additional smoke tests. One of these involves an install from source of [the psutil package](https://github.com/giampaolo/psut... | a33ca2ad1fcf857817cba505a788e15cf9d6ed0c | 54060ae91da2df44b3f6e6c698694d40284687e9 |
python/cpython | python__cpython-102492 | # Remove legacy ironpython 2 version check
<!--
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/tutorial/
... | 382ee2f0f2be662fbcabcb4a6b38de416cea0cae | 699cb20ae6fdef8b0f13d633cf4858465ef3469f |
python/cpython | python__cpython-112557 | # PyCFunction_New is not documented
`PyCFunction_New`, `PyCFunction_NewEx` and `PyCMethod_New`, which can be used to turn `PyMethodDef` into a Python callable, are currently not documented, though they're useful, stable, and used in the wild.
<!-- gh-linked-prs -->
### Linked PRs
* gh-112557
* gh-114119
* gh-114120
<... | a482bc67ee786e60937a547776fcf9528810e1ce | c361a1f395de9e508b6e1b0a4c5e69204905a7b7 |
python/cpython | python__cpython-102457 | # Remove docstring and getopt short options for deleted option "python -m base64 -t"
The `-t` option for base64 `python -m base64 -t` is removed in the PR https://github.com/python/cpython/pull/94230
But some references still exist in the docstring and getopt short options. Because of this we can still run the foll... | d828b35785eeb590b8ca92684038f33177989e46 | 06249ec89fffdab25f7088c86fcbbfdcebcc3ebd |
python/cpython | python__cpython-105856 | # datetime library doesn't support valid ISO-8601 alternative for midnight
<!--
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:/... | b0c6cf5f17f0be13aa927cf141a289f7b76ae6b1 | 68e384c2179fba41bc3be469e6ef34927a37f4a5 |
python/cpython | python__cpython-102445 | # Several minor bugs in `test_typing` highlighted by pyflakes
Following #102437 by @JosephSBoyle, I tried running pyflakes on `test_typing.py`. It highlighted:
- Another instance where a test isn't testing what it was meant to be testing
- An instance where a test is entirely duplicated
- Several unused imports or ... | 96e10229292145012bc462a6ab3ce1626c8acf71 | 32220543e2db36c6146ff2704ed1714a6adecc1b |
python/cpython | python__cpython-102449 | # `isinstance` on `runtime_checkable` `Protocol` has side-effects for `@property` methods
For example:
```python
from typing import Protocol, runtime_checkable
@runtime_checkable
class X(Protocol):
@property
def myproperty(self): ...
class Y:
@property
def myproperty(self):
raise Runt... | 5ffdaf748d98da6065158534720f1996a45a0072 | 08b67fb34f4519be1b0bb4673643a2c761c7ae92 |
python/cpython | python__cpython-102467 | # Pegen improperly memoizes loop rules
# Bug report
In the following part of pegen, the memoized result is only used if `self._should_memoize(node)` is true. Since loop rules are autogenerated, they are not marked with `(memo)`, so this is always false. Despite that, in the end the result is memoized based on the d... | f533f216e6aaba3f36639ae27210420e7dcf9de1 | 6716254e71eeb4666fd6d1a13857832caad7b19f |
python/cpython | python__cpython-102407 | # codecs can use PEP-678 notes instead of wrapping/chaining exceptions
[In codecs.c](https://github.com/python/cpython/blob/cb944d0be869dfb1189265467ec8a986176cc104/Python/codecs.c#L397) there is a call to _PyErr_TrySetFromCause (a function that is only called from here), which tries to create a new exception of the s... | 76350e85ebf96df588384f3d9bdc20d11045bef4 | e6ecd3e6b437f3056e0a410a57c52e2639b56353 |
python/cpython | python__cpython-105251 | # Document the build process for WASI
While it's great we have Python scripts to automate the WASI build process, it would probably be good to write down the process the scripts follow as independent documentation.
<!-- gh-linked-prs -->
### Linked PRs
* gh-105251
<!-- /gh-linked-prs -->
| 70dc2fb9732ba3848ad3ae511a9d3195b1378915 | e01b04c9075c6468ed57bc883693ec2a06a6dd8e |
python/cpython | python__cpython-102412 | # Logging's msecs doesn't handle "100ms" well.
# Bug report
`LogRecord.msecs` returns an incorrect value when timestamp (`self.ct`) value has exactly 100ms.
One liner check:
```python
assert int((1677793338.100_000_0 - int(1677793338.100_000_0)) * 1000) + 0.0 == 100.0
```
The issue is binary representa... | 1316692e8c7c1e1f3b6639e51804f9db5ed892ea | 1a1e013a4a526546c373afd887f2e25eecc984ad |
python/cpython | python__cpython-102399 | # Possible race condition in signal handling
The following code segfaults the interpreter on Linux. Tested on current main.
```py
import gc
import _thread
gc.set_threshold(1, 0, 0)
def cb(*args):
_thread.interrupt_main()
gc.callbacks.append(cb)
def gen():
yield 1
g = gen()
g.__next__... | 1a84cc007e207f2dd61f86a7fc3d86632fdce72f | 061325e0d2bbec6ff89d03f527c91dc7bfa14003 |
python/cpython | python__cpython-102389 | # Python cannot run in the ja_JP.sjis locale used windows-31j encoding.
<!--
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://do... | 1476ac2c58669b0a78d3089ebb9cc87955a1f5b0 | 177b9cb52e57da4e62dd8483bcd5905990d03f9e |
python/cpython | python__cpython-102390 | # Check documentation of PyObject_CopyData
According to the documentation, `PyObject_CopyData` takes two arguments of type `Py_buffer*`:
https://github.com/python/cpython/blob/71db5dbcd714b2e1297c43538188dd69715feb9a/Doc/c-api/buffer.rst?plain=1#L502
But in the implementation, it actually takes two arguments of `P... | 7b9132057d8f176cb9c40e8324f5122a3132ee58 | 4e7c0cbf59595714848cf9827f6e5b40c3985924 |
python/cpython | python__cpython-102382 | # raising an exception in a dict/code/function watcher callback will segfault on a DEALLOCATED event
Because the object we pass into the callback is dead (zero refcount), and if the callback raises an error we try to `PyErr_WriteUnraisable` with that object as context, which increfs and decrefs it, which recursively a... | 1e703a473343ed198c9a06a876b25d7d69d4bbd0 | a33ca2ad1fcf857817cba505a788e15cf9d6ed0c |
python/cpython | python__cpython-102379 | # `inspect._signature_strip_non_python_syntax` doesn't need to strip `/`
`inspect._signature_strip_non_python_syntax` removes `/`, this is probably a historical thing dating before Python 3.8 made this real Python syntax.
Removing this "feature" would simplify code in `inspect`.
<!-- gh-linked-prs -->
### Linked P... | 71cf7c3dddd9c49ec70c1a95547f2fcd5daa7034 | c6858d1e7f4cd3184d5ddea4025ad5dfc7596546 |
python/cpython | python__cpython-102372 | # Move _Py_Mangle from compile.c to symtable.c
_Py_Mangle doesn't need to be in compile.c (which is > 10K lines and needs to be reduced).
Moving it to symtable.c will
(1) remove one reason for symtable.c to depend on compile.c
(2) make typeobject.c depend on the much smaller symtable.c instead of on compile.c
(... | 71db5dbcd714b2e1297c43538188dd69715feb9a | 73250000ac7d6a5e41917e8bcea7234444cbde78 |
python/cpython | python__cpython-112942 | # `_osx_support.get_platform_osx()` does not always return the minor release number
`_osx_support.get_platform_osx()`, particularly when called from `sysconfig.get_platform()`, might not return the minor release number. This seems to be because the `MACOSX_DEPLOYMENT_TARGET` environment variable will be used instead (... | 893c9ccf48eacb02fa6ae93632f2d0cb6778dbb6 | 4cfce3a4da7ca9513e7f2c8ec94d50f8bddfa41b |
python/cpython | python__cpython-102426 | # Stack overflow on GC of deeply nested filter()
<!--
Use this template for hard crashes of the interpreter, segmentation faults, failed C-level assertions, and similar.
Do not submit this form if you encounter an exception being unexpectedly raised from a Python function.
Most of the time, these should be fi... | 66aa78cbe604a7c5731f074b869f92174a8e3b64 | 5da379ca7dff44b321450800252be01041b3320b |
python/cpython | python__cpython-102696 | # Usage of venv specifies a python3 command not found in 3.11.2 on Windows
# Documentation
The documentation on using `venv` at https://docs.python.org/3/library/venv.html for 3.11.2 specifies to use a `python3` executable.
I do not find a `python3` executable in the 3.11.2 installation for Windows 64-bit.
<!--... | 80abd62647b2a36947a11a6a8e395061be6f0c61 | 1ff81c0cb67215694f084e51c4d35ae53b9f5cf9 |
python/cpython | python__cpython-102345 | # implement winreg QueryValue / SetValue using QueryValueEx / SetValueEx
# Feature or enhancement
`QueryValue` and `SetValue` can be implemented using `QueryValueEx` and `SetValueEx`. These are compatible with more windows API families.
<!-- gh-linked-prs -->
### Linked PRs
* gh-102345
<!-- /gh-linked-prs -->... | c1748ed59dc30ab99fe69c22bdbab54f93baa57c | d3d20743ee1ae7e0be17bacd278985cffa864816 |
python/cpython | python__cpython-102342 | # Improve the test function for pow
Currently in the `powtest` function in `Lib/test/test_pow.py` file we are not testing the results of calling pow with negative exponents.
This PR will add appropriate assert statements to test the results of calling pow with negative exponents.
<!-- gh-linked-prs -->
### Linked PR... | 32220543e2db36c6146ff2704ed1714a6adecc1b | 7894bbe94ba319eb650f383cb5196424c77b2cfd |
python/cpython | python__cpython-102337 | # Remove Windows 7 specific code
# Feature or enhancement
There are still a couple of code sections special handling Windows 7. Removing at least part of those is required for https://github.com/python/cpython/issues/102255. So we might as well go ahead and clean up a large part of those.
<!-- gh-linked-prs -->
##... | 938e36f824c5f834d6b77d47942ad81edd5491d0 | 360ef843d8fc03aad38ed84f9f45026ab08ca4f4 |
python/cpython | python__cpython-102325 | # Improve tests of `typing.override`
Right now we have several things to improve:
1. This branch is not covered by tests: https://github.com/python/cpython/blob/4c87537efb5fd28b4e4ee9631076ed5953720156/Lib/typing.py#L3490 We don't have a single test that ensures that `@override` will not fail for some weird cases. S... | 12011dd8bafa6867f2b4a8a9e8e54cb0fbf006e4 | 71db5dbcd714b2e1297c43538188dd69715feb9a |
python/cpython | python__cpython-103663 | # (🐞) Column marker in error message off when line contains non ASCII character
```py
b"Ā"
```
```
👉 python test.py
File "/test.py", line 1
b"Ā"
^
SyntaxError: bytes can only contain ASCII literal characters
```
Here the caret is pointing to blackspace after the code
So each non-ASCII c... | 0fd38917582aae0728e20d8a641e56d9be9270c7 | 7bf94568a9a4101c72b8bf555a811028e5b45ced |
python/cpython | python__cpython-102309 | # Interpreter generator should emit code closer to pure C
Rather than emitting macros such as `DISPATCH`, `POKE`, `TARGET` etc, it would be useful if the code generator emitted something closer to plain C. Some macros will still be needed for portability.
Doing so would make the overhead in dispatch explicit and ex... | b5ff38243355c06d665ba8245d461a0d82504581 | e1a90ec75cd0f5cab21b467a73404081eaa1077f |
python/cpython | python__cpython-102514 | # Move _Py_RefTotal to PyInterpreterState
(See gh-100227.)
`_Py_RefTotal` holds the current global total number of refcounts. It only exists if `Py_REF_DEBUG` is defined (implied by `Py_DEBUG`). It is exposed by `sys.gettotalrefcount()` and set by `Py_INCREF()`, `Py_DECREF()`, etc. and `_Py_NewReference()`.
Mo... | cbb0aa71d040022db61390380b8aebc7c04f3275 | 11a2c6ce516b24b2435cb627742a6c4df92d411c |
python/cpython | python__cpython-102303 | # Make inspect.Parameter.__hash__ use _default instead of default
# Feature or enhancement
Enable subclasses of Parameter to add a `default` property accessing hash(self) rather than having hash rely on the `default` property
# Pitch
I wanted to make a subclass of Parameter which would store as _default the s... | 90801e48fdd2a57c5c5a5e202ff76c3a7dc42a50 | c2bd55d26f8eb2850eb9f9026b5d7f0ed1420b65 |
python/cpython | python__cpython-102301 | # Reuse objects with refcount == 1 in specialized instructions
Many VM instructions consume references to their operands and produce a reference to a result, often of the same type.
For some of those, we specialize for common types.
We can speed up the operations by reusing one of the operands if the refcount is o... | 233e32f93614255bf5fc7c93cd98af453e58cc98 | 78e4e6c3d71980d4e6687f07afa6ddfc83e29b04 |
python/cpython | python__cpython-102297 | # Documenting that inspect.Parameter.kind attributes support ordering
# Documentation
As described [here](https://discuss.python.org/t/documenting-that-inspect-parameter-kind-attributes-are-a-sorted-intenum/24103).
This is more an improvement proposition than a documentation _problem_ strictly speaking.
<!-- gh-l... | 0db6f442598a1994c37f24e704892a2bb71a0a1b | e3c3f9fec099fe78d2f98912be337d632f6fcdd1 |
python/cpython | python__cpython-102282 | # potential nullptr dereference + use of uninitialized memory in fileutils
# Bug report
https://github.com/python/cpython/blob/6daf42b28e1c6d5f0c1a6350cfcc382789e11293/Python/fileutils.c#L2161-L2162 can lead to use of uninitialized memory when `join_relfile` fails.
https://github.com/python/cpython/blob/6daf42b2... | afa6092ee4260bacf7bc11905466e4c3f8556cbb | 2b5781d659ce3ffe03d4c1f46e4875e604cf2d88 |
python/cpython | python__cpython-102264 | # Confusion in regular expression syntax example.
In the 3.11 documentation, the regular expression syntax section reads, in part:
> To match a literal ']' inside a set, precede it with a backslash, or place it at the beginning of the set. For example, both `[()[\]{}]` and `[]()[{}]` will both match a parenthesis.
... | bcadcde7122f6d3d08b35671d67e105149371a2f | d71edbd1b7437706519a9786211597d95934331a |
python/cpython | python__cpython-102256 | # Improve build support on xbox
# Feature or enhancement
Since there are probably more game studios using Python for their game scripting, it would be great to have better build support for CPython on the xbox. The xbox runs a windows, but does not provide all the APIs cpython is using under windows.
<!-- gh-linke... | c6858d1e7f4cd3184d5ddea4025ad5dfc7596546 | ca066bdbed85094a9c4d9930823ce3587807db48 |
python/cpython | python__cpython-102253 | # Acceptance of bool objects by complex() is not tested
Such operations as `complex(False) == 0j` is not covered by `test_bool.py`
<!-- gh-linked-prs -->
### Linked PRs
* gh-102253
* gh-102257
* gh-102258
<!-- /gh-linked-prs -->
| 41970436373f4be813fe8f5a07b6da04d5f4c80e | a35fd38b57d3eb05074ca36f3d57e1993c44ddc9 |
python/cpython | python__cpython-102254 | # Fix Refleak in test_import
Commit 096d0097a09e (for gh-101758) resulted in refleak failures. It's unclear if the leak is new or if the test simply exposed it. In 984f8ab018f847fe8d66768af962f69ec0e81849, I skipped the leaking tests until we can fix the leak.
UPDATE: I've updates the tests to only skip when che... | bb0cf8fd60e71581a90179af63e60e8704c3814b | 0db6f442598a1994c37f24e704892a2bb71a0a1b |
python/cpython | python__cpython-102287 | # Regression segfault under CPython 3.12a5 in the SymPy test suite
# Crash report
This comes from https://github.com/sympy/sympy/pull/24776 which adds CPython 3.12 prerelease testing in SymPy's CI.
This is seen with CPython 3.12a5 but not with 3.11 or earlier versions.
The reproducer is to run the SymPy test ... | e3c3f9fec099fe78d2f98912be337d632f6fcdd1 | 101a12c5767a8c6ca6e32b8e24a462d2606d24ca |
python/cpython | python__cpython-102806 | # cProfile does not work in pdb
<!--
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/tutorial/
- posting i... | 244567398370bfa62a332676762bb1db395c02fc | 5cc6c80a7797c08c884edf94de4fc7b6075e32ce |
python/cpython | python__cpython-102248 | # Improve the Efficiency of Python3.11.1 __getattr__
# Feature or enhancement
`__getattr__` in Python3.11.1 is much slower than `@Property` and visiting an object's attribute. It's even slower than Python3.10.4.
`_PyObject_GenericGetAttrWithDict` is the key reason. If Python3 fails finding an attribute in normal w... | 059bb04245a8b3490f93dfd72522a431a113eef1 | efb0a2cf3adf4629cf4669cb558758fb78107319 |
python/cpython | python__cpython-102212 | # re.Pattern and re.Match aren’t advertised
# Documentation
The `re` documentation only documents the classes’ methods, but not their existence as part of the `re` module.
`typing` however mentions their existence, so I assume they are officially supported.
<!-- gh-linked-prs -->
### Linked PRs
* gh-102212
* gh... | 6895ddf6cb2bada7e392eb971c88ded03d8fc79e | 53470184091f6fe1c7a1cf4de8fd90dc2ced7654 |
python/cpython | python__cpython-102225 | # test_implied_dirs_performance is flaky
Reported [in discord](https://discord.com/channels/854719841091715092/868504620970962944/1078325012651593768), since #102018, the timing check was added to `test_implied_dirs_performance` and this check is frequently failing ([example](https://github.com/python/cpython/actions/... | 89b4c1205327cc8032f4a39e3dfbdb59009a0704 | 2db23d10bf64bf7c061fd95c6a8079ddc5c9aa4b |
python/cpython | python__cpython-102193 | # Replace Fetch/Restore etc by the new exception APIs
PyErr_Fetch/Restore etc are now legacy APIs, in some places we can replace them by more efficient alternatives.
<!-- gh-linked-prs -->
### Linked PRs
* gh-102193
* gh-102196
* gh-102218
* gh-102319
* gh-102466
* gh-102472
* gh-102477
* gh-102619
* gh-102631
* gh... | 4c87537efb5fd28b4e4ee9631076ed5953720156 | 85b1fc1fc5a2e49d521382eaf5e7793175d00371 |
python/cpython | python__cpython-102182 | # Improve stats presentation for specialization
`SEND` and `FOR_ITER` use the same function to count the type of failure of specialization, which should require a minor improvement to make the correct specialization fail kind appear.
For example.
### Before improvement:
<summary> specialization stats for SEND f... | 373bca0cc5256dc512ffc22bdff4424f7ee8baa2 | 7b8d7f56b64ab4370fea77e77ea4984dd2a73979 |
python/cpython | python__cpython-102180 | # os.dup2() raises wrong OSError for negative fds
<!--
If you're new to Python and you're not sure whether what you're experiencing is a bug, the CPython issue tracker is not
the right place to seek help. Consider the following options instead:
- reading the Python tutorial: https://docs.python.org/3/tutori... | c2bd55d26f8eb2850eb9f9026b5d7f0ed1420b65 | 705487c6557c3d8866622b4d32528bf7fc2e4204 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.