Navigation Menu

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

Settign LANG=C modifies the --version behavior #78005

Closed
hroncok mannequin opened this issue Jun 10, 2018 · 7 comments
Closed

Settign LANG=C modifies the --version behavior #78005

hroncok mannequin opened this issue Jun 10, 2018 · 7 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@hroncok
Copy link
Mannequin

hroncok mannequin commented Jun 10, 2018

BPO 33824
Nosy @vstinner, @jwilk, @ned-deily, @hroncok, @miss-islington
PRs
  • bpo-33824, bpo-32030: Fix pymain_read_conf() #7712
  • [3.7] bpo-33824, bpo-32030: Fix pymain_read_conf() (GH-7712) #7730
  • 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 2018-06-15.22:37:51.828>
    created_at = <Date 2018-06-10.19:35:37.667>
    labels = ['interpreter-core', '3.8', 'type-bug', '3.7']
    title = 'Settign LANG=C modifies the --version behavior'
    updated_at = <Date 2018-06-15.22:37:51.825>
    user = 'https://github.com/hroncok'

    bugs.python.org fields:

    activity = <Date 2018-06-15.22:37:51.825>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-06-15.22:37:51.828>
    closer = 'vstinner'
    components = ['Interpreter Core']
    creation = <Date 2018-06-10.19:35:37.667>
    creator = 'hroncok'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 33824
    keywords = ['patch']
    message_count = 7.0
    messages = ['319238', '319239', '319627', '319629', '319681', '319684', '319686']
    nosy_count = 5.0
    nosy_names = ['vstinner', 'jwilk', 'ned.deily', 'hroncok', 'miss-islington']
    pr_nums = ['7712', '7730']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue33824'
    versions = ['Python 3.7', 'Python 3.8']

    @hroncok
    Copy link
    Mannequin Author

    hroncok mannequin commented Jun 10, 2018

    On 3.6, setting LANG to C did not affect the --version behavior:

    $ python3.6 --version
    Python 3.6.5
    
    $ LANG=C python3.6 --version
    Python 3.6.5

    On 3.7.0b5 it does.

    $ python3.7 --version
    Python 3.7.0b5
    
    $ LANG=C python3.7 --version
    Python 3.7.0b5 (default, Jun  1 2018, 03:54:41) 
    [GCC 8.1.1 20180502 (Red Hat 8.1.1-1)]

    My locale:

    LANG=cs_CZ.utf8
    LC_CTYPE="cs_CZ.utf8"
    LC_NUMERIC="cs_CZ.utf8"
    LC_TIME="cs_CZ.utf8"
    LC_COLLATE="cs_CZ.utf8"
    LC_MONETARY="cs_CZ.utf8"
    LC_MESSAGES="cs_CZ.utf8"
    LC_PAPER="cs_CZ.utf8"
    LC_NAME="cs_CZ.utf8"
    LC_ADDRESS="cs_CZ.utf8"
    LC_TELEPHONE="cs_CZ.utf8"
    LC_MEASUREMENT="cs_CZ.utf8"
    LC_IDENTIFICATION="cs_CZ.utf8"
    LC_ALL=

    BTW I'm running Fedora builds of Python, where we have PEP-538 on 3.6 as well https://fedoraproject.org/wiki/Changes/python3_c.utf-8_locale

    @hroncok hroncok mannequin added 3.7 (EOL) end of life type-bug An unexpected behavior, bug, or error labels Jun 10, 2018
    @ned-deily
    Copy link
    Member

    Odd. I see the same behavior with the python.org macOS builds so it's not just Fedora.

    @jwilk
    Copy link
    Mannequin

    jwilk mannequin commented Jun 15, 2018

    First bad commit is:
    9454060
    (bpo-29240, bpo-32030: Py_Main() re-reads config if encoding changes)

    @vstinner
    Copy link
    Member

    The bug is a regression caused by the PEP-540 (UTF-8 Mode) and my work to rewrite Py_Main(). My PR 7712 fixes the bug.

    @vstinner
    Copy link
    Member

    New changeset 6c5a4b3 by Victor Stinner in branch 'master':
    bpo-33824, bpo-32030: Fix pymain_read_conf() (GH-7712)
    6c5a4b3

    @miss-islington
    Copy link
    Contributor

    New changeset 046da16 by Miss Islington (bot) in branch '3.7':
    bpo-33824, bpo-32030: Fix pymain_read_conf() (GH-7712)
    046da16

    @vstinner
    Copy link
    Member

    Ned: I let you decide if this bug should be backported to 3.7.0 final or not.

    I would prefer to see this fix in 3.7.0, since Py_Main() refactoring was complex and maybe this bug hides another bug. The memset() is safe and make the code more reliable.

    @vstinner vstinner added interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.8 only security fixes labels Jun 15, 2018
    @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.7 (EOL) end of life 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants