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

expose lowlevel setlocale #38927

Closed
mhammond opened this issue Jul 24, 2003 · 5 comments
Closed

expose lowlevel setlocale #38927

mhammond opened this issue Jul 24, 2003 · 5 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs)

Comments

@mhammond
Copy link
Contributor

BPO 776854
Nosy @loewis, @mhammond
Files
  • locale.patch: New patch adding the method to 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/mhammond'
    closed_at = <Date 2004-08-25.22:59:25.000>
    created_at = <Date 2003-07-24.10:17:37.000>
    labels = ['interpreter-core']
    title = 'expose lowlevel setlocale'
    updated_at = <Date 2004-08-25.22:59:25.000>
    user = 'https://github.com/mhammond'

    bugs.python.org fields:

    activity = <Date 2004-08-25.22:59:25.000>
    actor = 'mhammond'
    assignee = 'mhammond'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2003-07-24.10:17:37.000>
    creator = 'mhammond'
    dependencies = []
    files = ['5491']
    hgrepos = []
    issue_num = 776854
    keywords = ['patch']
    message_count = 5.0
    messages = ['44351', '44352', '44353', '44354', '44355']
    nosy_count = 2.0
    nosy_names = ['loewis', 'mhammond']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue776854'
    versions = []

    @mhammond
    Copy link
    Contributor Author

    I propose (for post 2.3) we expose a lowlevel
    setlocale() for diagnostic purposes. Specifically, I
    propose that release builds support only querying the
    current locale, but Py_DEBUG builds be capable of
    bypassing Python completely.

    This is somewhat complementary to [ 774665 ] making
    Python LC_NUMERIC agnostic

    This would be extremely good for Windows - hence my
    patch adds such a method to the "msvcrt" module.
    However, I believe it worthy of consideration for
    locale itself, seeing as it is impossible to have
    Python-related side effects in release builds. For
    people running debug builds (or capable of switching to
    them) it provides invaluable help.

    Assigning to Tim to pronounce on. Either reject it,
    accept for msvcrt (and I will check it in post 1.3) or
    accept in principle for _locale, then assign back.

    @mhammond mhammond self-assigned this Jul 24, 2003
    @mhammond mhammond added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jul 24, 2003
    @mhammond mhammond self-assigned this Jul 24, 2003
    @mhammond mhammond added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jul 24, 2003
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jul 24, 2003

    Logged In: YES
    user_id=21627

    I accept that in principle for _locale, unconditionally,
    under a name different from "setlocale".

    @mhammond
    Copy link
    Contributor Author

    Logged In: YES
    user_id=14198

    Attached is a patch which names the new method
    "locale._setlocale()"

    An alternative and possibly better name would be
    "getcrtlocale()" - any thoughts?

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Aug 25, 2004

    Logged In: YES
    user_id=21627

    AFAICT, the only change left between this function and
    _locale.setlocale is that the latter also adjusts
    string.upper etc. I wonder whether we should take this code
    out of _localemodule.c, and move it into locale.py. In that
    case, you could just use _locale.setlocale, right? What do
    you think?

    @mhammond
    Copy link
    Contributor Author

    Logged In: YES
    user_id=14198

    Thanks Martin - so similar in fact that it is no longer
    needed! You revision 2.46 "Patch bpo-774665: Make Python
    LC_NUMERIC agnostic." provides the same basic functionality.

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

    No branches or pull requests

    1 participant