[Patches] [ python-Patches-776854 ] expose lowlevel setlocale

SourceForge.net noreply at sourceforge.net
Wed Aug 25 07:51:36 CEST 2004


Patches item #776854, was opened at 2003-07-24 12:17
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=776854&group_id=5470

Category: Core (C code)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Mark Hammond (mhammond)
Assigned to: Mark Hammond (mhammond)
Summary: expose lowlevel setlocale

Initial Comment:
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.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2004-08-25 07:51

Message:
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?

----------------------------------------------------------------------

Comment By: Mark Hammond (mhammond)
Date: 2004-08-25 00:34

Message:
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?

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2003-07-24 20:24

Message:
Logged In: YES 
user_id=21627

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

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=776854&group_id=5470


More information about the Patches mailing list