Skip to content

Update usages of PySys_FormatStderr with locale-dependent strerror #128022

Open
@picnixz

Description

@picnixz

strerror is locale-dependent but PySys_FormatStderr is not. The usage is

cpython/Modules/main.c

Lines 377 to 379 in 7303f06

// TODO(picnixz): strerror() is locale dependent but not PySys_FormatStderr().
PySys_FormatStderr("%S: can't open file %R: [Errno %d] %s\n",
program_name, filename, errno, strerror(errno));
and we should update it to be locale-dependent. This is a follow-up to #126746 (comment).

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions