cpython
cpython copied to clipboard
Deprecate readinto() fallback path in _pickle.c
| BPO | 39734 |
|---|---|
| Nosy | @pitrou, @ZackerySpytz, @pierreglaser |
| PRs |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = None
created_at = <Date 2020-02-23.22:47:08.376>
labels = ['type-feature', 'library', '3.9']
title = 'Deprecate readinto() fallback path in _pickle.c'
updated_at = <Date 2020-03-30.22:10:26.404>
user = 'https://github.com/pitrou'
bugs.python.org fields:
activity = <Date 2020-03-30.22:10:26.404>
actor = 'ZackerySpytz'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2020-02-23.22:47:08.376>
creator = 'pitrou'
dependencies = []
files = []
hgrepos = []
issue_num = 39734
keywords = ['patch']
message_count = 1.0
messages = ['362547']
nosy_count = 4.0
nosy_names = ['pitrou', 'ogrisel', 'ZackerySpytz', 'pierreglaser']
pr_nums = ['19237']
priority = 'low'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue39734'
versions = ['Python 3.9']
In bpo-39681 we reestablished the fallback to read() when a file-like object doesn't provide readinto() in _pickle.c. However, doing so leads to lower performance and all file-like object should nowadays provide readinto() (simply by deriving from the right base class - e.g. io.BufferedIOBase).
I propose to issue a DeprecationWarning when the fallback behaviour is selected, so that one day we can finally remove it.