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-98103 | # Create modular packages for zipfile and test_zipfile
I'm about to embark on once again syncing changes from [zipp](/jaraco/zipp) to `zipfile`.
Historically, I've manually copied the contents of the [cpython branch](/jaraco/zipp/tree/cpython) to the relevant files in this repository, but that process is error pron... | 003f341e99234cf6088341e746ffef15e12ccda2 | 78365b8e283c78e23725748500f48dd2c2ca1161 |
python/cpython | python__cpython-98573 | # Remove more deprecated importlib APIs from Python 3.12
Issue #97850 is the meta issue tracking removals of long deprecated functions from importlib. This ticket tracks just the removals of the following previously deprecated APIs:
- [x] `find_loader()`
- [x] `find_module()`
- [x] `imp` module
- [x] `importlib... | e1f14643dc0e6024f8df9ae975c3b05912a3cb28 | 79b9db9295a5a1607a0b4b10a8b4b72567eaf1ef |
python/cpython | python__cpython-98031 | # socket: add missing TCP socket options from Linux
# Feature or enhancement
`socket` modules already know most TCP socket options (`TCP_NODELAY`, `TCP_MAXSEG`, `TCP_CORK`, etc.) but not the recent ones.
Here is the complete list from the last Linux kernel version:
https://elixir.bootlin.com/linux/v6.0/source/i... | cce836296016463032495c6ca739ab469ed13d3c | 90d5c9b195a8133688c2d7b6ad9e0ca8b76df1df |
python/cpython | python__cpython-98004 | # Inline call frames for CALL_FUNCTION_EX
* Inline frames for both call types.
<!-- gh-linked-prs -->
### Linked PRs
* gh-98004
<!-- /gh-linked-prs -->
| ed95e8cbd4cbc813666c7ce7760257cc0f169d03 | accb417c338630ac6e836a5c811a89d54a3cd1d3 |
python/cpython | python__cpython-98120 | # `pydoc` renders `from builtins.type` note, even if it is incorrect
While working on https://github.com/python/cpython/pull/97958 I've noticed that there's something strange with `help()` and `classmethod`s.
Take a look at this example:
```python
import pydoc
class My:
@classmethod
def __init_subc... | 1aa74ee5c5f4647c12c21ab3f5262a33d263bb35 | 80ba8e85490515c293959a4196cbd99b1b3819a2 |
python/cpython | python__cpython-103996 | # Docs use deprecated Sphinx `.. index::` entries
In https://github.com/python/cpython/pull/97921#issuecomment-1269131226 @hugovk noticed that [Sphinx has deprecated some of the `.. index::` entry types](https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#index-generating-markup):
> module, ... | d0122372f2acb4cc56b89ab8c577ff9039d17d89 | cd9a56c2b0e14f56f2e83dd4db43c5c69a74b232 |
python/cpython | python__cpython-100598 | # Refresh importlib.resources
This bug tracks the sync with importlib_resources 5.x ([history](https://importlib-resources.readthedocs.io/en/latest/history.html)) into Python 3.12. For now, 5.9, but probably some other releases soon.
- [x] 5.9 (#97929)
- [x] 5.10 (#100598)
- [x] 5.12 (#102010)
<!-- gh-linked-p... | 447d061bc7b978afedd3b0148715d2153ac726c5 | ba1342ce998c6c0c36078411d169f29179fbc9f6 |
python/cpython | python__cpython-98484 | # tkinter.Text.count(index1, index2) returns None not (0,) when index1 equals index2
Surely the Text.count() method should return (0,) in the title code snippet? Following the example of what happens when more than one option is given.
I suppose the text_count method should do so too, but it was a hack of somethin... | b8c20f90492f9ef2c4600e2739f8e871a31b93c3 | 81eba7645082a192c027e739b8eb99a94b4c0eec |
python/cpython | python__cpython-100089 | # Some C struct members are not marked up in docs
The members of [PyMemberDef](https://docs.python.org/3/c-api/structures.html#c.PyMemberDef) aren't marked up as members, so they can't be linked to individually.
<!-- gh-linked-prs -->
### Linked PRs
* gh-100089
* gh-100311
* gh-100312
<!-- /gh-linked-prs -->
| 8edcb30c3f8bdd8099a093146fedbd9b63a3f667 | a6f82f1fc68cb24e2d88d35fde4cfb663213a744 |
python/cpython | python__cpython-100054 | # Docs for some C struct members repeat the struct name
The members of [PyType_Spec](https://docs.python.org/3/c-api/type.html?highlight=pytype_spec#c.PyType_Spec.PyType_Spec.name) are documented as e.g. `PyType_Spec.PyType_Spec.name`:
` and `help(typing._AnnotatedAlias)` should document the `__metadata__` field; based on the comments in #89543 the field was meant to be public but was inadvertently omitted from the PEP and documentation.
<!-- gh-linked-prs -->
#... | dc604a8c58af748ce25aee1af36b6521a3592fa5 | a28e2ce3fbcc852959324879e0bbf5ba8ecf0105 |
python/cpython | python__cpython-101826 | # Compiler warning for `_Py_InIntegralTypeRange`
# Bug report
```
Python/pytime.c:297:10: warning: implicit conversion from 'long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Wimplicit-int-float-conversion]
if (!_Py_InIntegralTypeRange(time_t, intpart)) {
^~~~~~~~~~~~... | b022250e67449e0bc49a3c982fe9e6a2d6a7b71a | 8de59c1bb9fdcea69ff6e6357972ef1b75b71721 |
python/cpython | python__cpython-97665 | # Improved usability of WASM web REPL for testing/development.
# Feature or enhancement
There's a demo python WASM REPL included in cpython for development and testing purposes.
It has the following issues:
* It's currently impossible to 'stop' the python process - an infinite loop means you have to close the b... | 010aaa32fb93c5033a698d7213469af02d76fef3 | 0d07182821fad7b95a043d006f1ce13a2d22edcb |
python/cpython | python__cpython-101652 | # `asyncio.Task.print_stack` doesn't use `sys.stderr` by default
`asyncio.Task.print_stack` is described by documentation as having a default output file of `sys.stderr`. However, the default `None` is passed all the way to `print` statements, leading to an actual default of `sys.stdout`.
<!-- gh-linked-prs -->
### L... | f87f6e23964d7a4c38b655089cda65538a24ec36 | 6fd5eb640af19b535f4f2ba27b1b61b8d17f02e9 |
python/cpython | python__cpython-97652 | # Lack of a blank line after `.. impl-detail::`
# Documentation
This issue is made for translation work of documentation.
The issue is that if a blank line was absent after `.. impl-detail::`, the Sphinx would not build the paragraph after this line during HTML file generation for zh-tw translation.
I found thi... | e8165d47b852e933c176209ddc0b5836a9b0d5f4 | dcc82331c8f05a6a149ac15c519d4fbae72692b2 |
python/cpython | python__cpython-96825 | # `ftplib.FTP.voidcmd` incorrectly document the return value
# Documentation
Since 2f3941d743481ac48628b8b2c075f2b82762050b this function returns the response string, rather than the nothing which is currently documented..
<!-- gh-linked-prs -->
### Linked PRs
* gh-96825
* gh-115601
* gh-115602
<!-- /gh-linked-p... | e88ebc1c4028cf2f0db43659e513440257eaec01 | 26800cf25a0970d46934fa9a881c0ef6881d642b |
python/cpython | python__cpython-104136 | # Null characters in strings cause a C SystemError
# Crash report
Putting a null byte into a Python string causes a SystemError in Python 3.10, due to a call to strlen in the string parsing library. In Python 3.9, the following example runs without errors:
```
# -*- coding: latin-1 -*-
"""
<NULL>
"""
```
... | ef0df5284f929719b2ef3955b1b569ade0a5193c | 55d50d147c953fab37b273bca9ab010f40e067d3 |
python/cpython | python__cpython-102421 | # Analyze and improve `test_asyncio.py`: right now it might be flaky
Openning as proposed in https://github.com/python/cpython/issues/97535#issuecomment-1257220241
We had multiple issues with `test_asyncio` before. Some tests are changing env, some are just flaky:
- https://github.com/python/cpython/issues/97535
... | a74cd3ba5de1aad1a1e1ee57328b54c22be47f77 | eff9f43924fc836970b2378d58523388d9246194 |
python/cpython | python__cpython-99503 | # termios.tcdrain hangs on MacOS
# Bug report
The following Python program hangs forever on MacOS, but does not hang on Linux:
```
import os, termios, time
device_fd, tty_fd = os.openpty()
def loop():
while True:
data = os.read(device_fd, 1)
print(data) # <--- never gets here
... | 959ba45d75953caa911e16b4c2a277978fc4b9b0 | 4d82f628c44490d6fbc3f6998d2473d1304d891f |
python/cpython | python__cpython-97906 | # Port PyPy's new unicode name db format to optimize binary CPython size
# Feature or enhancement
PyPy has a new algorithm that might help us reduce the unicode name db size of our binaries (which would be helpful on our way forward to better WASM compatibility [through reduced download sizes]). For more details, y... | 9573d142157d8432f2772a109c304dafeaa454a5 | 0e9c364f4ac18a2237bdbac702b96bcf8ef9cb09 |
python/cpython | python__cpython-96932 | # ssl.SSLSocket.shared_ciphers always returns server cipher list
<!--
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.pyth... | af9c34f6ef8dceb21871206eb3e4d350f6e3d3dc | ea93bde4ece139d4152a59f2c38aa6568559447c |
python/cpython | python__cpython-114227 | # IDLE: Stop reusing built-in names as parameters
Some idlelib functions use built-in names such as 'object', 'dict', and 'type' as function parameter names. As a result, these parameter names are mistakenly highlighted as builtin names. Unless a parameter name is used as a keyword in any call of the function, chang... | 6f4b242a03e521a55f0b9e440703b424ed18ce2f | 8cda72037b262772399b2b7fc36dee9340d74fd6 |
python/cpython | python__cpython-106455 | # Show value in error of list.remove
Consider
```python
foo = ["a", "b"]
for i in ["c"]:
foo.remove(i)
```
This throws with a useless error message:
```
Traceback (most recent call last):
File "/Users/tdegeus/Downloads/t.py", line 3, in <module>
foo.remove(i)
ValueError: list.remove(x): x not in... | f6cdc6b4a191b75027de342aa8b5d344fb31313e | 2a4cbf17af19a01d942f9579342f77c39fbd23c4 |
python/cpython | python__cpython-98518 | # Rewrite `asyncio.wait_for` using `asyncio.timeout`
Over the years a lot of issues have accumulated for `asyncio.wait_for` and the code has become complicated. The `asyncio.timeout` can be used to simplify this a lot and will also fix bugs which are already fixed or don't exist in `asyncio.timeout`. This rewrite won'... | a5024a261a75dafa4fb6613298dcb64a9603d9c7 | 226484e47599a93f5bf033ac47198e68ff401432 |
python/cpython | python__cpython-106660 | # Improved replacement functionality for deprecated crypt module
# Documentation
The `crypt` module is deprecated for 3.11. At the top of the doc page (https://docs.python.org/3/library/crypt.html), it suggests that maybe `hashlib` can provide a replacement, or PEP 594. Neither of these were very helpful.
What I... | da264121f4a529504dd931bad2b0af351df67d39 | 3a4231dd745e54ae533ce46371637f1fe8fa6a7b |
python/cpython | python__cpython-96716 | # Redundant NULL check in profile_trampoline function (sysmodule.c)
Code in `profile_trampoline` function checks if `arg` argument value is equal to `NULL` and in this case assigns `Py_None` to it
https://github.com/python/cpython/blob/88a7f661ca02c0eb76b8f19234b8293b70f171e2/Python/sysmodule.c#L954-L956
The only pl... | 3221b0de6792145cb4d0d461065a956db82acc93 | 621a1790c4d9e316c7228a13735bf71f2b0f5372 |
python/cpython | python__cpython-103232 | # Better error message for assignment to non-existent __slots__
# Feature or enhancement
Currently, the error message for an attribute that isn't included in a class's `__slots__` is harder to understand than I think it needs to be.
```pycon
Python 3.12.0a0 (heads/main:4114bcc, Sep 7 2022, 19:35:54) [Clang 13... | cdeb1a6caad5e3067f01d6058238803b8517f9de | 41ca16455188db806bfc7037058e8ecff2755e6c |
python/cpython | python__cpython-96639 | # pty.spawn deadlock
# Bug report
```
% yes | python3 -c "import pty; pty.spawn(['cat'])"
y
...
y^CTraceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.10/pty.py", line 181, in spawn
_copy(master_fd, master_read, stdin_read)
File "/usr/lib/python3.10/pty.p... | 9c5aa8967bd7c1b02fb1da055c6b3afcccbbb251 | c26d03d5d6da94367c7f9cd93185616f2385db30 |
python/cpython | python__cpython-96561 | # SyntaxError for walrus target in a comprehension when the target is a global variable with a private name.
# Bug report
If I have a walrus target with a private name, contained in a comprehension, the compiler mangles the name just fine.
However, if the name is declared global in a function containing the compre... | 664965a1c141e8af5eb465d29099781a6a2fc3f3 | e88ebc1c4028cf2f0db43659e513440257eaec01 |
python/cpython | python__cpython-117815 | # configure.ac: using $CC to check compiler names may result in erroneous judgements
configure.ac contains multiple checks of this kind:
```
case $CC in
```
When paths contain "clang"/"gcc"/"icc", they might be part of $CC
for example because of the "--sysroot" parameter. That could cause
judgement error about... | a5b94d066016be63d632cccee0ec2a2eb24536dc | 75f7cf91ec5afc6091a0fd442a1f0435c19300b2 |
python/cpython | python__cpython-96311 | # argparse sometimes tracebacks when all options in a mutually exclusive group are suppressed
# Bug report
When a subparser contains a mutually exclusive group and the all options in the group are suppressed,
it sometimes errors out with a traceback. The crash depends on other options (their ordering and length) a... | de1428f8c234a8731ced99cbfe5cd6c5c719e31d | 49258efada0cb0fc58ccffc018ff310b8f7f4570 |
python/cpython | python__cpython-100351 | # ntpath.normpath('\\\\') produces different result on Windows
In Python 3.11.0rc1 on Windows:
```python
>>> import ntpath
>>> ntpath.normpath('\\\\')
'\\\\'
```
In Python 3.11.0rc1 on non-Windows platforms, and in 3.10 across all platforms:
```python
>>> import ntpath
>>> ntpath.normpath('\\\\')
'\\'... | 005e69403d638f9ff8f71e59960c600016e101a4 | eecd422d1ba849f0724962666ba840581217812b |
python/cpython | python__cpython-96194 | # os.path.ismount() doesn't properly use byte-paths from an os.DirEntry
# Bug report
It seems that `os.path.ismount()` doesn't properly use a bytes-path from an `os.DirEntry` object (despite both claiming to support/be PathLike).
Take e.g. the following code, when called with a bytes `path`:
```
def scandirtre... | 367f552129341796d75fc4cc40edb49405235a2b | 1455c516fce829f8d46e4f15557afe8653e7e995 |
python/cpython | python__cpython-106451 | # sqlite3 docs: explain SELECT-with-literals trick
Some examples use the following SQL trick:
```python3
# setup code; we only need a "dummy" connection
import sqlite3
cx = sqlite3.connect(":memory:")
# returns one row with one column: ("a",)
row = cx.execute("select 'a' as literal").fetchone()
# do stuff... | f520804b039df0d87fb9df6f1fed2a9bc9df8d61 | fc7ff1af457e27b7d9752600b3436641be90f598 |
python/cpython | python__cpython-96335 | # Calling inspect.signature with an AsyncMock instance raises an exception
<!--
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:/... | 9e7d7266ecdcccc02385fe4ccb094f3444102e26 | a109454e828ce2d9bde15dea78405f8ffee653ec |
python/cpython | python__cpython-113819 | # TimeoutError not raised by 'timeout' context manager when "side errors" occur
Consider something like this:
```py
async with asyncio.timeout(1):
try:
await asyncio.sleep(2) # Will be interrupted after 1 second
finally:
1/0 # Crash in cleanup
```
This will report `ZeroDivisionError` ... | aef4a1203c06efde8505aefc9cf994e9a23f398d | ab0ad62038317a3d15099c23d2b0f03bee9f8fa7 |
python/cpython | python__cpython-98429 | # Edit What's New for Python 3.11
As discussed with @pablogsal , this is a meta-issue for coordinating an editing pass on the What's New in Python 3.11 document.
The focus with this issue and its accompanying PRs will be on textual and reST/Sphinx fixes and improvements to the existing content, rather than adding a... | 80b19a30c0d5f9f8a8651e7f8847c0e68671c89a | 8606697f49dc58ff7e18147401ac65a09c38cf57 |
python/cpython | python__cpython-95897 | # posixmodule.c: osdefs.h inclusion should not depend on compiler
osdefs.h should not be defined by the compiler used, this small patch moves an inclusion out of an _MSC_VER check into an MS_WINDOWS one to better honour the assumption that compiler and OS macros are independent
<!-- gh-linked-prs -->
### Linked PRs
*... | ec2b76aa8b7c6313293ff9c6814e8bc31e08fcaf | a86d8545221b16e714ffe3bda5afafc1d4748d13 |
python/cpython | python__cpython-95883 | # Trackstack includes __aexit__ in contextlib which is not in previous versions
```python
import contextlib
@contextlib.asynccontextmanager
async def f():
try:
yield
finally:
pass
async def amain():
async with f(): 1/0
with contextlib.closing(amain().__await__()) as gen:... | b3722ca058f6a6d6505cf2ea9ffabaf7fb6b6e19 | 85869498331f7020e18bb243c89cd694f674b911 |
python/cpython | python__cpython-107221 | # Target libc based suffix (-musl/-gnu) in PLATFORM_TRIPLET is chosen based on build machine configuration instead of configuration of the target
That, as an example, leads to cpython 3.9.13 build failing[^1] when cross-compiling on AMD64 Linux with glibc for mpc8548 Linux (OpenWrt) with musl.
As already described ... | c163d7f0b67a568e9b64eeb9c1cbbaa127818596 | 809ea7c4b6c2b818ae510f1f58e82b6b05ed4ef9 |
python/cpython | python__cpython-125376 | # Ambiguity in behavior of ArgumentParser prefix_chars when same flag is specified with different prefixes
## Environment
```
$ python --version
Python 3.8.10
$ uname -a
Linux 4.4.0-19041-Microsoft #1237-Microsoft Sat Sep 11 14:32:00 PST 2021 x86_64 x86_64 x86_64 GNU/Linux
```
## Description
It seems that fl... | dbcc5ac4709dfd8dfaf323d51f135f2218d14068 | 7b04496e5c7ed47e9653f4591674fc9ffef34587 |
python/cpython | python__cpython-99571 | # os.remove is documented to raise IsADirectoryError but macOS raises PermissionError
# Documentation
In the documentation for `os.remove` it states:
> Remove (delete) the file path. If path is a directory, an [IsADirectoryError](https://docs.python.org/3/library/exceptions.html#IsADirectoryError) is raised. Use... | 1cae31d26ba621f6b1f0656ad3d69a0236338bad | cdde29dde90947df9bac39c1d19479914fb3db09 |
python/cpython | python__cpython-102343 | # [subinterpreter] Make type version tag counter threadsafe for per interpreter GIL
The `next_version_tag` in `typeobject.c` is currently not thread safe and relies on GIL to protect against concurrent increments across threads.
https://github.com/python/cpython/blob/63140b445e4a303df430b3d60c1cd4ef34f27c03/Object... | 0acea96dad622cba41bf1e9ee25d87658579ba88 | d8627999d85cc5b000dbe17180250d919f8510ad |
python/cpython | python__cpython-99709 | # Negative `_io.BufferedReader.tell`
# Bug report
I believe `tell` should never be negative, even for `/dev/urandom`. And @benjaminp wrote [ToDo](https://github.com/python/cpython/blob/cc9160a29bc3356ced92348bcd8e6668c67167c9/Modules/_io/bufferedio.c#L1189) that it shouldn't be negative.
```
>>> from pathlib im... | 26800cf25a0970d46934fa9a881c0ef6881d642b | d5a30a1777f04523c7b151b894e999f5714d8e96 |
python/cpython | python__cpython-100627 | # CVE-2020-10735: Prevent DoS by large int<->str conversions
## Problem
A Denial Of Service (DoS) issue was identified in CPython because we use binary bignum’s for our `int` implementation. A huge integer will always consume a near-quadratic amount of CPU time in conversion to or from a base 10 (decimal) string wi... | 46521826cb1883e29e4640f94089dd92c57efc5b | f4fcfdf8c593611f98b9358cc0c5604c15306465 |
python/cpython | python__cpython-112577 | # Add more specific error message when file has same name as an imported module
# Feature / enhancement
Currently, if a python file I create and am trying to run has the same name as a module I'm importing in it (i.e. my file is named `random.py` and I try to do `import random; print(random.randint(5))`, the followin... | 61e818409567ce452af60605937cdedf582f6293 | 2d91409c690b113493e3e81efc880301d2949f5f |
python/cpython | python__cpython-102207 | # test_tar test_add_dir_getmember fails if uid/gid is larger than 16777215
# Bug report
The [`test_add_dir_getmember`](https://github.com/python/cpython/blob/12d92c733cfc00ee630b30e4e0250da400c83395/Lib/test/test_tarfile.py#L223) added in https://github.com/python/cpython/pull/30283 fails if the current user's uid ... | 56e93c8020e89e1712aa238574bca2076a225028 | 54dfa14c5a94b893b67a4d9e9e403ff538ce9023 |
python/cpython | python__cpython-102119 | # pipe test failures on some Linux configurations
# Bug report
On Linux systems, when configured with a default pipe capacity of 4096, the following test fail:
- test_fcntl.test_fcntl_f_pipesize
- test_subprocess.test_pipesizes
From a recent `fcntl(2)` Linux [man page](https://man7.org/linux/man-pages/man2/... | d5c7954d0c3ff874d2d27d33dcc207bb7356f328 | 0d4c7fcd4f078708a5ac6499af378ce5ee8eb211 |
python/cpython | python__cpython-107536 | # New asyncio ssl implementation is lacking license and origin information
# Bug report
In GH-31275 / GH-88177 a new asyncio ssl implementation was added. The code was copied from uvloop project. The commit message 13c10bfb777483c7b02877aab029345a056b809c lacks information about origin, original authors, and origin... | dce30c9cbc212e5455e100f35ac6afeb30dfd23e | 8aa126354d93d7c928fb35b842cb3a4bd6e1881f |
python/cpython | python__cpython-118105 | # Remove unused indent_level from Modules/_json.c
There are commits from 2009-05-02 calculating indent_level but not
using it to indent. There are some other commits from 2011-02-22
commenting out the code with the message "it does not work". Nobody cared
enough about it for 10 years, time to remove commented code ... | 05adfbba2abafcdd271bf144a7b3f80bcd927288 | 7758be431807d574e0f1bbab003796585ae46719 |
python/cpython | python__cpython-95378 | # Add support for other image formats(e.g. PNG) to the turtle module
# Feature or enhancement
Add support for PGM, PPM, and PNG formats to *turtle.bgpic()* and *turtle.register_shape()*.
# Pitch
Currently, *turtle* only supports GIF format for an image file,
where as the backend *tkinter.PhotoImage* supports... | e1baa778f602ede66831eb34b9ef17f21e4d4347 | 60c65184695a3eab766b3bc26fc99f695deb998f |
python/cpython | python__cpython-101039 | # Remove bundled setuptools
# Feature or enhancement
Remove the bundled setuptools so that `ensurepip` and `python -m venv` only installs pip.
# Context
The `setup.py install` command of `setuptools` is deprecated.
However, in an environment where `setuptools` is installed but `wheel` is not (such as one c... | ece20dba120a1a4745721c49f8d7389d4b1ee2a7 | f39e00f9521a0d412a5fc9a50f2a553ec2bb1a7c |
python/cpython | python__cpython-99506 | # failing configure command
# Bug report
When trying to build Python from source code on Mac, the configure command fails.
[config.log](https://github.com/python/cpython/files/9180910/config.log)
# Your environment
Python Version: 3.10.5
Operating System:
MacOS Monterey 12.3
64 Bit x68, Intel core CPU
... | 8f024a02d7d63315ecc3479f0715e927f48fc91b | 8f18ac04d32515eab841172c956a8cb14bcee9c3 |
python/cpython | python__cpython-119888 | # Improve error message when using `in` for object that is not container
# Feature or enhancement
When using `in` to test containment, for example `if "a" in b:`, if b does not support the `in` operator, then it would raise an error message: `TypeError: Argument of type b is not iterable`.
To the reader/debugge... | dc03ce797ae8786a9711e6ee5dcaadde02c55864 | 65fededf9cc1780d5edbef8a6e0a7cf9bc15aea6 |
python/cpython | python__cpython-103779 | # String formatting clarification
https://docs.python.org/3/library/string.html#formatstrings has the following -
`An expression of the form '.name' selects the named attribute using [getattr()], while an expression of the form '[index]' does an index lookup using __getitem__().`
An expression of the form [1] co... | 3e7316d7e8969febb56fbc7416d483b073bd1702 | 9a89f1bf1e7bb819fe7240be779c99a84f47ea46 |
python/cpython | python__cpython-95151 | # Argument Clinic: add support for deprecating positional use of parameters
**Feature or enhancement**
Suggesting to add syntax for producing deprecation warnings for positional use of optional parameters.
I made a [proof-of-concept patch](https://github.com/erlend-aasland/cpython/pull/37) for this where I intro... | 33cb0b06efe33968eb32463fa1b02b5a729a17f8 | 3c8e8f3ceeae08fc43d885f5a4c65a3ee4b1a2c8 |
python/cpython | python__cpython-99740 | # [Enum] Enhance repr() when inheriting from dataclass
In 3.10 and prior, a combined dataclass/enum such as
from dataclasses import dataclass
from enum import Enum
@dataclass(frozen=True)
class CreatureDataMixin:
size: str
legs: int
class Creature(CreatureDataMixin, E... | 2b2d607095335024e5e2bb358e3ef37650536839 | 616468b87bc5bcf5a4db688637ef748e1243db8a |
python/cpython | python__cpython-94962 | # `unitest.mock.create_autospec(async_def)` does not create functions valid for `inspect.iscoroutinefunction`
discovered while creating https://github.com/python/cpython/pull/94923
**Bug report**
```python
import unittest.mock
import inspect
import asyncio
import sys
def main():
async def demo():
... | 9bf8d825a66ea2a76169b917c12c237a6af2ed75 | 0f885ffa94aa9b69ff556e119cb17deb23a5a4b3 |
python/cpython | python__cpython-103881 | # Let math.nextafter() compute multiple steps at a time.
Sometimes ``math.nextafter()`` needs to be applied multiple times in succession.
x = nextafter(nextafter( nextafter(x, inf), inf), inf) # Three steps up
It would be nice if the function supported this directly:
x = nextafter(x, inf, n... | 6e39fa19555043588910d10f1fe677cf6b04d77e | c3f43bfb4bec39ff8f2c36d861a3c3a243bcb3af |
python/cpython | python__cpython-102684 | # Check for ref counting bugs in debug mode caused by immortal objects.
With https://github.com/python/cpython/issues/90699, the identifiers are statically allocated and are immortal. This makes it easy to make reference counting mistakes as they are not detected and cause negative ref count in `_Py_RefTotal`.
On m... | a703f743dbf2675948e59c44fa9d7112f7825100 | 88c262c086077377b40dfae5e46f597e28ffe3c9 |
python/cpython | python__cpython-104409 | # Help latest MSVC 1932 (v143, VS2022) to optimize PyObject_Free()
There is a report that python.org `3.11` Windows release has slowed down on micro benchmarks:
https://github.com/faster-cpython/ideas/issues/420
One reason is that `PyObject_Free()` is not well optimized by the latest MSVC (ver.1932 in v143 tool ... | a10b026f0fdceac42c4b928917894d77da996555 | 79b17f2cf0e1a2688bd91df02744f461835c4253 |
python/cpython | python__cpython-94784 | # ProcessPoolExecutor deadlock when a child process crashes while data is being sent in call queue
**Bug report**
When using a ProcessPoolExecutor with forked child processes, if one of the child processes suddenly dies (segmentation fault, not a Python exception) and if simultaneously data is being sent into the c... | 6782fc050281205734700a1c3e13b123961ed15b | 9d582250d8fde240b8e7299b74ba888c574f74a3 |
python/cpython | python__cpython-112385 | # DocTest sorts by lineno which may be int or None
In `doctest.py` the following ordering is defined for the class `DocTest`:
```
def __lt__(self, other):
if not isinstance(other, DocTest):
return NotImplemented
return ((self.name, self.filename, self.lineno, id(self))
... | fbb9027a037ff1bfaf3f596df033ca45743ee980 | 19a1fc1b3df30f64450d157dc3a5d40c992e347f |
python/cpython | python__cpython-112756 | # Python 3.10/3.8: shutil.rmtree(None, ignore_errors=True) behaves differently between Windows and *nix platforms
**Bug report**
Expected behavior: Passing None to shutil.rmtree's path argument should not yield an exception when ignore_errors=True.
Behavior on MacOS Python 3.10 (MacPorts) - Correct behavior:
``... | 563ccded6e83bfdd8c5622663c4edb679e96e08b | bc68f4a4abcfbea60bb1db1ccadb07613561931c |
python/cpython | python__cpython-102663 | # [subinterpreters] Static types incorrectly share some objects between interpreters
While static types (`PyTypeObject` values) don't themselves ever change (once `PyType_Ready()` has run), they do hold mutable data. This means they cannot be safely shared between multiple interpreters without a common GIL (and witho... | e6ecd3e6b437f3056e0a410a57c52e2639b56353 | 8d015fa000db5775d477cd04dc574ba13721e278 |
python/cpython | python__cpython-94641 | # email.message get_payload throws UnicodeEncodeError with some surrogate Unicode characters
email.message get_payload gets a UnicodeEncodeError if the message body contains a line that has either:
a Unicode surrogate code point that is valid for surrogateescape encoding (U-DC80 through U-DCFF) and a non ASCII U... | 27a5fd8cb8c88537216d7a498eba9d9177951d76 | 3251ba8f1af535bf28e31a6832511ba19e96b262 |
python/cpython | python__cpython-94687 | # Port 23-argument `_posixsubprocess.fork_exec` to Argument Clinic
Currently the function is parsed with [the following behemoth](https://github.com/python/cpython/blob/main/Modules/_posixsubprocess.c#L816-L826):
```cpp
if (!PyArg_ParseTuple(
args, "OOpO!OOiiiiiiiiii" _Py_PARSE_PID "OOOiOp:fork_exec",... | 124af17b6e49f0f22fbe646fb57800393235d704 | 49cae39ef020eaf242607bb2d2d193760b9855a6 |
python/cpython | python__cpython-136217 | # Log formatters which use newlines to separate messages should quote newlines for security reasons
The logging module, in most common configurations, is vulnerable to [log injection](https://owasp.org/www-community/attacks/Log_Injection) attacks.
For example:
```python3
import logging
logging.basicConfig(form... | d05423a90ce0ee9ad5207dce3dd06ab2397f3d6e | 3e849d75f400569cbf3c29c356061c788284b71e |
python/cpython | python__cpython-98479 | # Tkinter Canvas.coords does not flatten arguments
**Bug report**
Double nested arrays in tk.coords will produce errors in tkinter (`_tkinter.TclError: wrong # coordinates: expected at least 4, got 2` in this case)
```py
import tkinter as tk
coords = [[100, 100], [300, 300]]
root = tk.Tk()
canvas = tk.Canv... | 9bc80dac47f6d43d0bbfbf10c4cc3848b175e97f | 6fba0314765d7c58a33e9859d9cd5bcc35d2fd0a |
python/cpython | python__cpython-94468 | # ProcessPoolExecutor shutdown hangs after future cancel was requested
**Bug report**
With a ProcessPoolExecutor, after submitting and quickly canceling a future, a call to `shutdown(wait=True)` would hang indefinitely.
This happens pretty much on all platforms and all recent Python versions.
Here is a minimal ... | 2dc94634b50f0e5e207787e5ac1d56c68b22c3ae | a44553ea9f7745a1119148082edb1fb0372ac0e2 |
python/cpython | python__cpython-111237 | # frame.setlineno has serious flaws.
The `frame_setlineno` function works in in stages:
* Determine a set of possible bytecode offsets as targets from the line number.
* Compute the stack state for these targets and the current position
* Determine a best target. That is, the first one that has a compatible stack.... | 6640f1d8d2462ca0877e1d2789e1721767e9caf2 | 4fbf20605bd70fb96711c92a0ce3309291ffd6fb |
python/cpython | python__cpython-112196 | # Deprecate typing.Hashable/Sized
[`typing.Hashable`](https://docs.python.org/3/library/typing.html#typing.Hashable) and [`typing.Sized`](https://docs.python.org/3/library/typing.html#typing.Sized) are aliases to their equivalents in the [`collections.abc module`](https://docs.python.org/3/library/collections.abc.html... | fb4cddb0cc6c9b94929f846da8e95aeec3849212 | 0ee2d77331f2362fcaab20cc678530b18e467e3c |
python/cpython | python__cpython-95318 | # Documentation: Error in datetime.datetime.strptime()
**Documentation**
The documentation for [datetime.datetime.strptime](https://docs.python.org/3/library/datetime.html#datetime.datetime.strptime) is incorrect:
https://github.com/python/cpython/blob/bb8b931385ba9df4e01f7dd3ce4575d49f60efdf/Doc/library/datetim... | 5b404d6cad2bf53295fdf96305f95efe1ea0174e | ed948e01bb68e3f026f38a7e43241d850ee1bfb5 |
python/cpython | python__cpython-114152 | # fnmatch module parameters names are not correct
**Documentation**
fnmatch module parameters names are not correct
```python
>>> import fnmatch
>>> fnmatch.fnmatch(filename='file.txt', pattern='*.txt')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: fnmatch() got an unex... | 6e84f3b56f445b56ab48723d636c0a17090298ab | 7092b3f1319269accf4c02f08256d51f111b9ca3 |
python/cpython | python__cpython-134712 | # Excess spaces at the end of files or repositorys are not handle when extracting zip files on Windows.
**Bug report**
Excess spaces at the end of files or repositorys are not handle when extracting zip files on Windows.
`FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Documents \\test.txt'`
Can be... | 965662ee4a986605b60da470d9e7c1e9a6f922b3 | 9eb84d83e00070cec3cfe78f1d0c7a7a0fbef30f |
python/cpython | python__cpython-119720 | # Officially deprecate and remove abcs in importlib.abc moved to importlib.resources.
In #90276, I grouped the functionality related to `importlib.resources` into its own package (creating clearer separation of responsibility from `importlib.*`). That included moving some abstract base classes from `importlib.abc` to ... | 0751511d24295c39fdf2f5b2255e3fa3d796ce4d | c8b45a385ab85c3f3463b1e7394c515e892dfba7 |
python/cpython | python__cpython-99695 | # [C API] Move PyFrame_* API to <Python.h>
Currently, getter functions of a Python frame object (PyFrameObject) are only accessible if the ``frameobject.h`` header is included explicitly. It's not documented in the frame doc: https://docs.python.org/dev/c-api/frame.html
In Python 3.11, the PyFrameObject structure w... | d15b9f19ac0ffb29b646735d69b29f48a71c247f | 995f6170c78570eca818f7e7dbd8a7661c171a81 |
python/cpython | python__cpython-103236 | # Change in semantics and much worse performance for enum members.
Given the enum:
```Python
class Colours(Enum):
RED = 1
```
In Python 3.9 and 3.10:
```Python
>>> Colours.__dict__["RED"] is Colours.RED
True
>>> Colours.RED.RED
<Colours.RED: 1>
```
In Python 3.11:
```Python
>>> Colours.__dict__["RE... | 4ec8dd10bd4682793559c4eccbcf6ae00688c4c3 | b4978ff872be5102117b4e25d93dbbb4e04c8292 |
python/cpython | python__cpython-132862 | # pdb cannot find source code for frozen stdlib modules
**Bug report**
Context: this issue came out of a discussion in #python on the Libera.chat IRC network, where a user wanted to peek into `importlib._bootstrap` with `pdb` while chasing a bug.
`pdb` is capable of stepping into function calls into frozen modul... | eef49c359505eaf109d519d39e53dfd3c78d066a | 0a387b311e617a9a614c593551d3c04a37331e53 |
python/cpython | python__cpython-120125 | # Bytecode positions seem way too broad
(Note that `dis` currently has a [bug](https://github.com/python/cpython/pull/93663) in displaying accurate location info in the presence of `CACHE`s. The correct information can be observed by working with `co_positions` directly or using the code from that PR.)
While develo... | eca3f7762c23b22a73a5e0b09520748c88aab4a0 | d68a22e7a68ae09f7db61d5a1a3bd9c0360cf3ee |
python/cpython | python__cpython-119485 | # Conditional backward edges should help "warm up" code
#93229 introduced a regression in how aggressively we quicken some `for` loops. Minimal example:
```py
def f(x: bool) -> None:
for i in range(1_000_000):
if x:
pass
```
`f(True)` will quicken this code, but `f(False)` will not, ... | 016a46ab572fc681e4a06760147b9ae311b21881 | 18c1a8d3a81bf8d287a06f2985bbf65c9a9b9794 |
python/cpython | python__cpython-98440 | # Finish deprecation in asyncio.get_event_loop()
Since 3.10 `asyncio.get_event_loop()` emits a deprecation warning if used outside of the event loop (see #83710). It is a time to turn a warning into error and make `asyncio.get_event_loop()` an alias of `asyncio.get_running_loop()`.
But maybe we should first deprec... | fd38a2f0ec03b4eec5e3cfd41241d198b1ee555a | b72014c783e5698beb18ee1249597e510b8bcb5a |
python/cpython | python__cpython-93776 | # Running the Python test suite leaks .pem files in /tmp
Running the Python test suite has two issues:
* A test leaks 3 .pem files in /tmp
* The test suite is not marked as failed when it leaks temporary files (in /tmp)
Moreover, test_tools enters an unlimited loop and fills the $TMPDIR directory if the $TMPDIR... | de1428f8c234a8731ced99cbfe5cd6c5c719e31d | 49258efada0cb0fc58ccffc018ff310b8f7f4570 |
python/cpython | python__cpython-127593 | # Expose PIDFD_NONBLOCK as os.PIDFD_NONBLOCK
**Feature or enhancement**
Expose `PIDFD_NONBLOCK` as `os.PIDFD_NONBLOCK` to be used with `os.waitid`.
**Pitch**
`pidfd_open` returns a nonblocking file descriptor if `PIDFD_NONBLOCK` is supplied as flag. If the process
referred to by the file descr... | fcbe6ecdb6ed4dd93b2ee144f89a73af755e2634 | 1ef6e8ca3faf2c2b008fb170c7c44c38b86e874a |
python/cpython | python__cpython-93224 | # Multiple TimedRotatingFileHandler with similar names but different backup counts do not work
**Bug report**
When setting up multiple logging handlers of type `TimedRotatingFileHandler` that log to the same directory and only differ by the file extension, rollover does not work properly for either of them.
Cons... | 113687a8381d6dde179aeede607bcbca5c09d182 | 347acded845d07b70232cade8d576b6f0aaeb473 |
python/cpython | python__cpython-100512 | # Document the thread safety of `functools.lru_cache`
**Documentation**
The documentation doesn't state whether `functools.lru_cache` (and decorators derived from it like `functools.cache`) are thread safe, meaning that it's not clear that it's safe to (for example) populate the cache by running the function in mul... | 2b3feec58f82fee5a8f74ef78e7061bfb73f09a2 | 3fdd43ef3507d0db65cff4dd8252e35f7b81988f |
python/cpython | python__cpython-117000 | # Enable test_cppext on Windows
Once source build virtual environments are properly detected, this test can successfully run on Windows.
Depends on #92897.
<!-- gh-linked-prs -->
### Linked PRs
* gh-117000
<!-- /gh-linked-prs -->
| a114d08a8912a50530ab3f19842c6ba73b0d1017 | 27cf3ed00cfe942f4277c273a3dda8ee2ba61fc8 |
python/cpython | python__cpython-129102 | # Ensure venv works with source builds when using --copies
Currently a venv created with `--copies` or on Windows doesn't respect the `sysconfig.is_python_build()` property of the creating interpreter. This leads to compilation errors when attempting to build extensions in the virtual environment.
<!-- gh-linked-prs... | e52ab564da84540a7544cb829f262b0154efccae | 5ed5572cac7ef204767ddf8e8888e15672ba558e |
python/cpython | python__cpython-99529 | # ARM64 macOS variadic arguments not passed properly in ctypes
**Bug report**
Using ctypes with variadic functions on ARM64 macOS machines seems to improperly pass the arguments, leading to truncation.
Minimal repro:
```py
>>> import ctypes
>>> from ctypes import util
>>> libc = ctypes.CDLL(util.find_libra... | bc3a11d21ddef28047b18c0f6a5068fa9fb16da2 | 959ba45d75953caa911e16b4c2a277978fc4b9b0 |
python/cpython | python__cpython-101055 | # No documentation for ast.Module class and others.
**Documentation**
The [documentation on the ast module](https://docs.python.org/3.10/library/ast.html) does not mention the `Module, Interactive, Expression, or FunctionType ` class. They should be added.
I haven't checked but I think these are the only module m... | 33608fd67df8b1033519f808441ee00289e2dac0 | a8210b6df1ed2793c484b3380182ba56c4254a4e |
python/cpython | python__cpython-95596 | # MRO: Behavior change from 3.10 to 3.11: multiple inheritance issue with C-API (pybind11)
<!--
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 t... | 906e4509328917fe9951f85457897f6a841e0529 | 89f52293281b6efc4ef666ef25e677683821f4b9 |
python/cpython | python__cpython-105267 | # socket.connect - support custom family value
**Feature or enhancement**
Currently `socket.connect()` accepts a wide range of values when connecting to a socket with the code in `socketmodule.c` transforming it based on the family the socket was created with. Unfortunately there is a check that fails the connectio... | 3907de12b57b14f674cdcc80ae64350a23af53a0 | b1a91d26c67250ff7abeb20064e7766096604001 |
python/cpython | python__cpython-101873 | # sqlite3: remove features deprecated in 3.10
The following sqlite3 features were deprecated in Python 3.10, and are scheduled for removal in Python 3.12:
- sqlite3.OptimizedUnicode: #23163
- sqlite3.enable_shared_cache: #24008
3.12 development was just opened, so these features can now be removed.
<!-- gh-lin... | 2db2c4b45501eebef5b3ff89118554bd5eb92ed4 | d9199175c7386a95aaac91822a2197b9365eb0e8 |
python/cpython | python__cpython-105208 | # PEP 623: Remove wstr from Unicode
**Feature or enhancement**
[PEP 623](https://peps.python.org/pep-0623/)
<!-- gh-linked-prs -->
### Linked PRs
* gh-105208
* gh-105210
<!-- /gh-linked-prs -->
| cbb9ba844f15f2b8127028e6dfd4681b2cb2376f | 146939306adcff706ebddb047f7470d148125cdf |
python/cpython | python__cpython-94627 | # Argparse choices should be a sequence
**Documentation**
Instead of saying "any container" is supported, refer only to "sequences".
Technically, a *Container* is only required to support ``__contains__`` which is insufficent for argparse. Also, a sets do get accepted are a bad choice because the order shown in ... | ad3c99e521151680afc65d3f8a7d2167ec1969ad | dbc1e696ebf273bc62545d999eb185d6c9470e71 |
python/cpython | python__cpython-103678 | # argparse.BooleanOptionalAction accepts and silently discards choices, metavar, and type arguments
This is an elaboration of issue #85039.
>>> parser = ArgumentParser()
>>> parser.add_argument('--foo', action=BooleanOptionalAction,
... choices=[1,2], metavar='FOOBAR', type=int) # doctest: +ELLIP... | 27a7d5e1cd5b937d5f164fce572d442672f53065 | ac56a854b418d35ad3838f3072604227dc718fca |
python/cpython | python__cpython-99977 | # Performance of attribute lookup for type objects
<!--
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/tutor... | 014f103705afef0c1c6d7dc740e6a4f21b2da794 | f9f0b21653721c0c2a62a2c125fa343784435bf6 |
python/cpython | python__cpython-92185 | # Zipfile module doesn't replace `os.altsep` in filenames in some cases
The zipfile module currently doesn't replace `os.altsep` with `/` in filename in cases where `os.altsep` is not `None` and not `"/"`.
I'm not currently aware of any cases where `os.altsep` is not `None` or `"/"`, so I don't think this is curren... | 4abfe6a14b5be5decbaa3142d9e2549cf2d86c34 | fcd5fb49b1d71165f3c503c3d2e74a082ddb2f21 |
python/cpython | python__cpython-99221 | # [subinterpreters] crash in _elementtree when parsing in parallel
<!--
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, ... | 3847a6c64b96bb2cb93be394a590d4df2c35e876 | 9109d460511a317f5598a26658ba495e77ea8686 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.