[Python-bugs-list] [ python-Bugs-528879 ] segfaults with nl_langinfo

noreply@sourceforge.net noreply@sourceforge.net
Tue, 12 Mar 2002 14:08:05 -0800


Bugs item #528879, was opened at 2002-03-12 10:03
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=528879&group_id=5470

Category: Extension Modules
Group: Python 2.2.1 candidate
>Status: Closed
>Resolution: Fixed
Priority: 6
Submitted By: Michael Piefel (piefel)
Assigned to: Martin v. L÷wis (loewis)
Summary: segfaults with nl_langinfo

Initial Comment:
import locale
locale.nl_langinfo(0x20032)

This crashes - no stack trace. Smaller constants work.


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

>Comment By: Martin v. L÷wis (loewis)
Date: 2002-03-12 23:08

Message:
Logged In: YES 
user_id=21627

The problem is that glibc's nl_langinfo sometimes returns
int values, instead of char*. E.g. 0x20032 is
_NL_TIME_ERA_NUM_ENTRIES, which returns the number of eras.
Use of these constants is not supported, so _locale shall be
changed to verify the arguments to check it is a supported
argument.

Fixed in _localemodule.c 2.26.

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

Comment By: Michael Hudson (mwh)
Date: 2002-03-12 11:02

Message:
Logged In: YES 
user_id=6656

_localemodule.c has Martin's name at the top of it, so he
gets this.

This would seem to be a bug in some versions of glibc --
nl_langinfo is setting errno and returning NULL.  Fixed just
over two years ago in glibc CVS, but obviously still "out
there".  Worth working around?  Shouldn't be too hard.

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

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