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

Broken python-config generated with Estonian locale #72445

Closed
Arfrever mannequin opened this issue Sep 23, 2016 · 10 comments
Closed

Broken python-config generated with Estonian locale #72445

Arfrever mannequin opened this issue Sep 23, 2016 · 10 comments
Assignees
Labels
3.7 (EOL) end of life build The build process and cross-build

Comments

@Arfrever
Copy link
Mannequin

Arfrever mannequin commented Sep 23, 2016

BPO 28258
Nosy @Yhg1s, @vstinner, @serhiy-storchaka
PRs
  • [Do Not Merge] Convert Misc/NEWS so that it is managed by towncrier #552
  • Files
  • python-use_C_locale.patch: Use C locale
  • 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 = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2016-09-29.17:48:56.040>
    created_at = <Date 2016-09-23.13:31:38.540>
    labels = ['build', '3.7']
    title = 'Broken python-config generated with Estonian locale'
    updated_at = <Date 2017-03-31.16:36:25.413>
    user = 'https://bugs.python.org/Arfrever'

    bugs.python.org fields:

    activity = <Date 2017-03-31.16:36:25.413>
    actor = 'dstufft'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2016-09-29.17:48:56.040>
    closer = 'serhiy.storchaka'
    components = ['Build']
    creation = <Date 2016-09-23.13:31:38.540>
    creator = 'Arfrever'
    dependencies = []
    files = ['44794']
    hgrepos = []
    issue_num = 28258
    keywords = ['patch']
    message_count = 10.0
    messages = ['277277', '277280', '277281', '277711', '277712', '277714', '277716', '277720', '277726', '277810']
    nosy_count = 5.0
    nosy_names = ['twouters', 'vstinner', 'Arfrever', 'python-dev', 'serhiy.storchaka']
    pr_nums = ['552']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue28258'
    versions = ['Python 2.7', 'Python 3.5', 'Python 3.6', 'Python 3.7']

    @Arfrever
    Copy link
    Mannequin Author

    Arfrever mannequin commented Sep 23, 2016

    When Estonian locale (e.g. et_EE.UTF-8) is set, then the following line in Makefile.pre.in does not match all required strings:

    sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config

    In Estonian locale:
    [A-Z] does not match: T, U, V, W, X, Y
    [a-z] does not match: t, u, v, w, x, y
    https://en.wikipedia.org/wiki/Estonian_orthography

    Run-time result without fix applied:

    $ LC_ALL=C bash python-config --help
    python-config: line 45: LDVERSION: command not found
    python-config: line 49: VERSION: command not found
    python-config: line 51: prefix: command not found
    python-config: line 51: VERSION: command not found
    Usage: python-config --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir

    I attach patch (also fixing distclean target).

    @Arfrever Arfrever mannequin assigned Yhg1s Sep 23, 2016
    @Arfrever Arfrever mannequin added 3.7 (EOL) end of life build The build process and cross-build labels Sep 23, 2016
    @Arfrever
    Copy link
    Mannequin Author

    Arfrever mannequin commented Sep 23, 2016

    I get "500 Server Error" page when trying to write response in Rietveld, so I will write here...

    On 2016/09/23 16:00:58, storchaka wrote:

    https://bugs.python.org/review/28258/diff/18650/Makefile.pre.in
    File Makefile.pre.in (right):

    https://bugs.python.org/review/28258/diff/18650/Makefile.pre.in#newcode1633
    Makefile.pre.in:1633: LC_ALL=C; find $(srcdir)/[a-zA-Z]* '(' -name '*.fdc' -o
    -name '*~' \
    Does it work with ";"?

    Yes.
    Expansion is performed here by shell (spawned by make) itself before arguments are passed to find.
    So LC_ALL=C must be set as a separate command.

    $ export LC_ALL=et_EE.UTF-8
    $ mkdir -p /tmp/test/{a,t,z}
    $ find /tmp/test/[a-zA-Z]*
    /tmp/test/a
    /tmp/test/z
    $ LC_ALL=C find /tmp/test/[a-zA-Z]*
    /tmp/test/a
    /tmp/test/z
    $ LC_ALL=C; find /tmp/test/[a-zA-Z]*
    /tmp/test/a
    /tmp/test/t
    /tmp/test/z
    $

    @serhiy-storchaka
    Copy link
    Member

    Thanks for your explanation, now I see this. The patch LGTM.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 29, 2016

    New changeset 6110997dd6e7 by Serhiy Storchaka in branch '3.5':
    Issue bpo-28258: Fixed build with Estonian locale (python-config and distclean
    https://hg.python.org/cpython/rev/6110997dd6e7

    New changeset 1b9e71f5de83 by Serhiy Storchaka in branch '3.6':
    Issue bpo-28258: Fixed build with Estonian locale (python-config and distclean
    https://hg.python.org/cpython/rev/1b9e71f5de83

    New changeset a2c5179bce01 by Serhiy Storchaka in branch 'default':
    Issue bpo-28258: Fixed build with Estonian locale (python-config and distclean
    https://hg.python.org/cpython/rev/a2c5179bce01

    New changeset f2247d1cb884 by Serhiy Storchaka in branch '2.7':
    Issue bpo-28258: Fixed build with Estonian locale (distclean target in
    https://hg.python.org/cpython/rev/f2247d1cb884

    @serhiy-storchaka serhiy-storchaka added the build The build process and cross-build label Sep 29, 2016
    @vstinner
    Copy link
    Member

    "LC_ALL=C; find" are you sure for ";"?

    @serhiy-storchaka
    Copy link
    Member

    This is the question that I asked Arfrever.

    @vstinner
    Copy link
    Member

    "Expansion is performed here by shell (spawned by make) itself before arguments are passed to find. So LC_ALL=C must be set as a separate command."

    Oh. I expected at least "export LANG" somewhere. IMHO it deserves a comment explaining the surprising ";".

    Does it work if it's written on two lines?

    @serhiy-storchaka
    Copy link
    Member

    Oh. I expected at least "export LANG" somewhere. IMHO it deserves a comment
    explaining the surprising ";".

    I don't know if export is needed. I see the same behavior with and without
    export.

    Does it work if it's written on two lines?

    No, it doesn't work.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 29, 2016

    New changeset 17f2b6b2e24c by Victor Stinner in branch '3.5':
    Issue bpo-28258: Explain the LC_ALL change in a comment
    https://hg.python.org/cpython/rev/17f2b6b2e24c

    New changeset f256bd5b8418 by Victor Stinner in branch '2.7':
    Issue bpo-28258: Explain the LC_ALL change in a comment
    https://hg.python.org/cpython/rev/f256bd5b8418

    @serhiy-storchaka
    Copy link
    Member

    Thanks Victor!

    @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 build The build process and cross-build
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants