-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
gh-87901: os.popen: Remove the encoding argument #92836
Conversation
Since the parameter was added to Python 3.11, I guess your intent is to backport this change to 3.11. What's the rationale for adding the parameter and then to remove it? #87901 doesn't give details. |
I want to fix EncodingWarning in stdlib as possible. Adding This PR doesn't fix the EncodingWarning in |
Since I wish I could deprecate os.popen(), I like the idea of suggesting users to use the subprocess module directly. It's just that I was surprised to see the parameter added and then removed. Now I understand the rationale, thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I just added a remark on the doc.
Doc/library/os.rst
Outdated
:func:`locale.getpreferredencoding(False) <locale.getpreferredencoding>`_. | ||
The :ref:`Python UTF-8 Mode <utf8-mode>` affects both encodings. | ||
|
||
Use :class:`subprocess.Popen` to control encoding and many other options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last sentence "... use subprocess to control encoding ..." is fine. But I'm not sure that it's worth it to maintain a documentation of the encoding used by subprocess here. I'm not against it ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks @methane for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
GH-92939 is a backport of this pull request to the 3.11 branch. |
No description provided.