Skip to content
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-100750: pass encoding kwarg in lib/platform.py #100751

Merged
merged 5 commits into from
Jan 20, 2023

Conversation

graingert
Copy link
Contributor

@graingert graingert commented Jan 4, 2023

@graingert graingert requested a review from methane January 4, 2023 14:43
@graingert graingert changed the title pass encoding='locale' kwarg in lib/platform.py gh-100750: pass encoding='locale' kwarg in lib/platform.py Jan 4, 2023
@graingert graingert marked this pull request as ready for review January 4, 2023 14:54
Lib/platform.py Outdated
@@ -824,6 +825,7 @@ def from_subprocess():
['uname', '-p'],
stderr=subprocess.DEVNULL,
text=True,
encoding="locale",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think uname output is not localized.
https://github.com/coreutils/coreutils/blob/8d4768c94d0fa9de545a6e1c370f9a6fae4cb3a7/src/uname.c#L314-L371

So we can use "utf-8" or "latin1" here.

@graingert graingert changed the title gh-100750: pass encoding='locale' kwarg in lib/platform.py gh-100750: pass encoding kwarg in lib/platform.py Jan 5, 2023
Lib/platform.py Outdated Show resolved Hide resolved
@graingert graingert requested a review from methane January 5, 2023 16:41
@ambv ambv added the needs backport to 3.11 only security fixes label Jan 20, 2023
@ambv ambv merged commit 6b3993c into python:main Jan 20, 2023
@miss-islington
Copy link
Contributor

Thanks @graingert for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 20, 2023
)

(cherry picked from commit 6b3993c)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
@bedevere-bot
Copy link

GH-101207 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jan 20, 2023
@graingert graingert deleted the pass-encoding-kwarg-in-platform branch January 20, 2023 22:43
miss-islington added a commit that referenced this pull request Jan 21, 2023
(cherry picked from commit 6b3993c)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
@jaraco jaraco added the needs backport to 3.10 only security fixes label Feb 7, 2023
@miss-islington
Copy link
Contributor

Thanks @graingert for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 7, 2023
)

(cherry picked from commit 6b3993c)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
@bedevere-bot
Copy link

GH-101644 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants