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

Disable coerce_c_locale and utf8_mode by default in _PyPreConfig? #80624

Closed
vstinner opened this issue Mar 26, 2019 · 3 comments
Closed

Disable coerce_c_locale and utf8_mode by default in _PyPreConfig? #80624

vstinner opened this issue Mar 26, 2019 · 3 comments
Labels
3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@vstinner
Copy link
Member

BPO 36443
Nosy @ncoghlan, @vstinner
PRs
  • bpo-36443: Disable C locale coercion and UTF-8 Mode by default #12589
  • 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 = <Date 2019-03-27.17:30:10.749>
    created_at = <Date 2019-03-26.23:04:10.529>
    labels = ['interpreter-core', '3.8']
    title = 'Disable coerce_c_locale and utf8_mode by default in _PyPreConfig?'
    updated_at = <Date 2019-03-27.17:30:10.748>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2019-03-27.17:30:10.748>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-03-27.17:30:10.749>
    closer = 'vstinner'
    components = ['Interpreter Core']
    creation = <Date 2019-03-26.23:04:10.529>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36443
    keywords = ['patch']
    message_count = 3.0
    messages = ['338922', '338978', '338980']
    nosy_count = 2.0
    nosy_names = ['ncoghlan', 'vstinner']
    pr_nums = ['12589']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue36443'
    versions = ['Python 3.8']

    @vstinner
    Copy link
    Member Author

    bpo-36301 created a very strict separated between Python initialization and a new "pre-initialization" which is responsible to configure encodings and memory allocators.

    Nick Coghlan proposed to disable UTF-8 Mode and C locale coercion by default in the pre-initialization, so the LC_CTYPE locale is not coerced by Python when it's embedded in an application.

    Maybe the UTF-8 Mode can be automatically enabled (depending on the LC_CTYPE locale), but not the C locale coercion?

    This issue is related to bpo-36202: Calling Py_DecodeLocale() before _PyPreConfig_Write() can produce mojibake.

    @vstinner vstinner added 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Mar 26, 2019
    @vstinner
    Copy link
    Member Author

    New changeset d929f18 by Victor Stinner in branch 'master':
    bpo-36443: Disable C locale coercion and UTF-8 Mode by default (GH-12589)
    d929f18

    @vstinner
    Copy link
    Member Author

    Done. I close the issue.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs)
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant