[New-bugs-announce] [issue16364] datetime.strftime and locale.getdefaultlocale conflict on Windows ?

jamesf report at bugs.python.org
Tue Oct 30 13:10:57 CET 2012


New submission from jamesf:

on windows(windows 7), python 2.7.3 compiled with VS 2008 and code page "cp936".

locale.getdefaultlocale call Win32 API GetACP and return "cp936",
but a small test program return "C" from 'getlocale' CRT function.
I am not sure if this behaviour is expected or bug?

It seems that datetime.strftime call the CRT function strftime to
do the real work, since the CRT locale is C, it use that to format
locale dependent directive like "%B" and "%x"; 
But since locale.getdefaultlocale return "cp936", so i expect
datetime.strftime to return locale formatted string.

----------
components: Library (Lib)
messages: 174203
nosy: jwfang
priority: normal
severity: normal
status: open
title: datetime.strftime and locale.getdefaultlocale conflict on Windows ?
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16364>
_______________________________________


More information about the New-bugs-announce mailing list