Skip to content

PEP 597: os.popen() uses locale encoding #87901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
methane opened this issue Apr 5, 2021 · 3 comments · Fixed by #92374
Closed

PEP 597: os.popen() uses locale encoding #87901

methane opened this issue Apr 5, 2021 · 3 comments · Fixed by #92374
Labels
3.11 only security fixes stdlib Python modules in the Lib dir

Comments

@methane
Copy link
Member

methane commented Apr 5, 2021

BPO 43735
Nosy @methane

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 2021-04-05.13:28:22.148>
labels = ['library', '3.10']
title = 'PEP 597: os.popen() and pipes uses locale encoding'
updated_at = <Date 2021-04-05.13:38:13.511>
user = 'https://github.com/methane'

bugs.python.org fields:

activity = <Date 2021-04-05.13:38:13.511>
actor = 'methane'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2021-04-05.13:28:22.148>
creator = 'methane'
dependencies = []
files = []
hgrepos = []
issue_num = 43735
keywords = []
message_count = 1.0
messages = ['390234']
nosy_count = 1.0
nosy_names = ['methane']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue43735'
versions = ['Python 3.10']

@methane
Copy link
Member Author

methane commented Apr 5, 2021

os.popen() and pipes module doesn't have encoding parameter. They use the default (locale) encoding implicitly.

As PEP-597, subprocess module won't emit EncodingWarning for PIPEs in Python 3.10.
Like that, we should just add encoding=None parameter but don't emit EncodingWarning.

@methane methane added 3.10 only security fixes stdlib Python modules in the Lib dir labels Apr 5, 2021
@methane methane changed the title os.popen() and pipes uses locale encoding PEP 597: os.popen() and pipes uses locale encoding Apr 5, 2021
@methane methane changed the title os.popen() and pipes uses locale encoding PEP 597: os.popen() and pipes uses locale encoding Apr 5, 2021
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@methane methane changed the title PEP 597: os.popen() and pipes uses locale encoding PEP 597: os.popen() uses locale encoding May 6, 2022
@methane
Copy link
Member Author

methane commented May 6, 2022

pipe is deprecated by PEP 594.

methane added a commit to methane/cpython that referenced this issue May 6, 2022
@methane methane added 3.11 only security fixes and removed 3.10 only security fixes labels May 6, 2022
@gpshead
Copy link
Member

gpshead commented May 6, 2022

FWIW I suggest a followup tweak making the new parameter keyword only.

methane added a commit to methane/cpython that referenced this issue May 7, 2022
methane added a commit to methane/cpython that referenced this issue May 16, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 19, 2022
miss-islington added a commit that referenced this issue May 19, 2022
(cherry picked from commit 96f6583)

Co-authored-by: Inada Naoki <[email protected]>
@methane methane closed this as completed May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes stdlib Python modules in the Lib dir
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants