Skip to content

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

Closed

Description

@hroncok
mannequin
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']

    Activity

    1. hroncok commented on Jun 10, 2018

      hroncokmannequin
      MannequinAuthor

      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

    2. ned-deily commented on Jun 10, 2018

      @ned-deily
      Member

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

    3. jwilk commented on Jun 15, 2018

      jwilkmannequin
      Mannequin

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

    4. vstinner commented on Jun 15, 2018

      @vstinner
      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.

    5. vstinner commented on Jun 15, 2018

      @vstinner
      Member

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

    6. miss-islington commented on Jun 15, 2018

      @miss-islington
      Contributor

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

    7. vstinner commented on Jun 15, 2018

      @vstinner
      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.

    8. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.7 (EOL)end of life3.8 (EOL)end of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions