[issue10466] locale.py throws exception on Windows / Non-UTF8 system

2010-11-20 Thread Sibylle Koczian

New submission from Sibylle Koczian :

Running locale.py as a module on Windows, using the Python command window, 
produces this output:

C:\Python31\Lib>locale.py
Locale aliasing:

Locale defaults as determined by getdefaultlocale():

Language:  de_DE
Encoding:  cp1252

Locale settings on startup:

LC_NUMERIC ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_MONETARY ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_COLLATE ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_CTYPE ...
   Language:  (undefined)
   Encoding:  (undefined)

LC_TIME ...
   Language:  (undefined)
   Encoding:  (undefined)


Locale settings after calling resetlocale():

Traceback (most recent call last):
  File "C:\Python31\Lib\locale.py", line 1798, in 
_print_locale()
  File "C:\Python31\Lib\locale.py", line 1761, in _print_locale
resetlocale()
  File "C:\Python31\Lib\locale.py", line 537, in resetlocale
_setlocale(category, _build_localename(getdefaultlocale()))
locale.Error: unsupported locale setting

Tried with 2.7 on Windows XP, 32bit, 3.1.2 and 3.2a4 on Windows 7, 64bit. 
System character set in all cases cp1252 as usual for a German windows 
installation.

With 2.6, 2.6.5, 3.1.2 on Linux with UTF-8 system character set: no exception, 
expected output.

--
components: Library (Lib)
messages: 121616
nosy: skoczian
priority: normal
severity: normal
status: open
title: locale.py throws exception on Windows / Non-UTF8 system
versions: Python 2.7, Python 3.1, Python 3.2

___
Python tracker 
<http://bugs.python.org/issue10466>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10466] locale.py throws exception on Windows / Non-UTF8 system

2010-11-21 Thread Sibylle Koczian

Sibylle Koczian  added the comment:

-Ursprüngliche Nachricht-
Von: "R. David Murray" 
Gesendet: 20.11.2010 15:37:28
An: nulla.epist...@web.de
Betreff: [issue10466] locale.py throws exception on Windows / Non-UTF8 system

>
>R. David Murray  added the comment:
>
>unsupported locale setting is a message that comes from the C runtime, IIUC.  
>Does it work on windows with 2.6?
>

No, it doesn't. I installed 2.6.6, and I found an old 2.3 (installed by some 
application). Both of them throw the same exception if locale is run as a 
script.
___
GRATIS! Movie-FLAT mit über 300 Videos. 
Jetzt freischalten unter http://movieflat.web.de

--

___
Python tracker 
<http://bugs.python.org/issue10466>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10466] locale.py resetlocale throws exception on Windows

2010-11-21 Thread Sibylle Koczian

Sibylle Koczian  added the comment:

Am 21.11.2010 20:04, schrieb R. David Murray:
>
> R. David Murray  added the comment:
>
> Given the long standing nature of this issue, it seems that the
> priority isn't very high, especially since the bug is revealed not by
> user code but by a diagnostic routine in the stdlib.
>

It's true that the bug is quite old, but first it crashed my 
application, then I found that locale.py doesn't run as a script. I put 
that into the tracker simply because it's so easy to reproduce.

But this is almost as simple (and it's the same bug, isn't it?):

Python 3.1.2 (r312:79149, Mar 20 2010, 22:55:39) [MSC v.1500 64 bit 
(AMD64)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import calendar
 >>> kal = calendar.localeHTMLCalendar()
Traceback (most recent call last):
   File "", line 1, in 
AttributeError: 'module' object has no attribute 'localeHTMLCalendar'
 >>> kal = calendar.LocaleHTMLCalendar()
 >>> kal_aus = kal.formatyearpage(2011)
Traceback (most recent call last):
   File "", line 1, in 
   File "C:\Python31\lib\calendar.py", line 478, in formatyearpage
 a(self.formatyear(theyear, width))
   File "C:\Python31\lib\calendar.py", line 454, in formatyear
 a(self.formatmonth(theyear, m, withyear=False))
   File "C:\Python31\lib\calendar.py", line 427, in formatmonth
 a(self.formatmonthname(theyear, themonth, withyear=withyear))
   File "C:\Python31\lib\calendar.py", line 546, in formatmonthname
 with different_locale(self.locale):
   File "C:\Python31\lib\calendar.py", line 489, in __enter__
 self.oldlocale = _locale.setlocale(_locale.LC_TIME, self.locale)
   File "C:\Python31\lib\locale.py", line 527, in setlocale
 return _setlocale(category, locale)
locale.Error: unsupported locale setting
 >>>

This would be quite unfunny if I couldn't run my script on Linux instead.

Sibylle

--

___
Python tracker 
<http://bugs.python.org/issue10466>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com