[ python-Bugs-920575 ] locale module is segfaulting on locale.ERA

SourceForge.net noreply at sourceforge.net
Sun Mar 21 15:05:43 EST 2004


Bugs item #920575, was opened at 2004-03-22 03:18
Message generated for change (Comment added) made by perky
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=920575&group_id=5470

Category: Extension Modules
Group: Python 2.3
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Matthias Klose (doko)
Assigned to: Hye-Shik Chang (perky)
Summary: locale module is segfaulting on locale.ERA

Initial Comment:
[forwarded from http://bugs.debian.org/239237]

Python2.3 is segfaulting when I'm using the locale
module in this way : 
 
Python 2.3.3 (#2, Feb 24 2004, 09:29:20)  
[GCC 3.3.3 (Debian)] on linux2 
Type "help", "copyright", "credits" or "license" for
more information. 
>>> import locale 
>>> locale.nl_langinfo(locale.CODESET) 
'ANSI_X3.4-1968' 
>>> locale.nl_langinfo(locale.D_T_FMT) 
'%a %b %e %H:%M:%S %Y' 
>>> locale.nl_langinfo(locale.ERA) 
zsh: 27439 segmentation fault  python 


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

>Comment By: Hye-Shik Chang (perky)
Date: 2004-03-22 05:05

Message:
Logged In: YES 
user_id=55188

Okay. Checked in 2.3 branch too.
Misc/NEWS 1.831.4.96
Modules/_localemodule.c 2.40.4.3

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

Comment By: Matthias Klose (doko)
Date: 2004-03-22 04:51

Message:
Logged In: YES 
user_id=60903

please consider the fix for 2.3 as well.


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

Comment By: Hye-Shik Chang (perky)
Date: 2004-03-22 04:45

Message:
Logged In: YES 
user_id=55188

A workaround checked in:
Misc/NEWS 1.956
Modules/_localemodule.c 2.45

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

Comment By: Hye-Shik Chang (perky)
Date: 2004-03-22 04:40

Message:
Logged In: YES 
user_id=55188

glibc is returning NULL for nl_langinfo(ERA). But it must
return "" instead of NULL according to SUSv2.

Quoting it:

RETURN VALUE

In a locale where langinfo data is not defined,
nl_langinfo() returns a pointer to the corresponding string
in the POSIX locale. In all locales, nl_langinfo() returns a
pointer to an empty string if item contains an invalid setting.

This pointer may point to static data that may be
overwritten on the next call.

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

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



More information about the Python-bugs-list mailing list