python / python/cpython

Update usages of `PySys_FormatStderr` with locale-dependent `strerror`

Open
#128,022 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

extension-modules type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

strerror is locale-dependent but PySys_FormatStderr is not. The usage is https://github.com/python/cpython/blob/7303f06846b69016a075bca7ad7c6055f29ad024/Modules/main.c#L377-L379 and we should update it to be locale-dependent. This is a follow-up to https://github.com/python/cpython/pull/126746#discussion_r1885039989.

This would be quite hard to test as pointed out by Serhiy, so I won't work on this for now. Others may pick that task.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Modules/main.c at lines 377-379 and read the linked pull request discussion for the rationale around PySys_FormatStderr and locale-dependent strerror output. Confirm the intended locale behavior and determine how completion can be validated, noting that the issue says this is difficult to test.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.