Closed dahlia closed 12 years ago
In Ubuntu Linux, its behavior (especially %b
formatter) is slightly different:
>>> locale.setlocale(locale.LC_ALL, 'ko_KR.UTF8')
'ko_KR.UTF8'
>>> time.strftime('%a, %d %b %Y %H:%M:%S GMT', t)
'\xec\x88\x98, 30 11\xec\x9b\x94 2011 09:55:06 GMT'
>>> print _
수, 30 11월 2011 09:55:06 GMT
Similar issues are common in python land. In gentoo, one generally recommends to switch locales before testing in style with LC_CTYPE=en_US.utf8 python foobar.py
.
The current implementation of RFC 822 formatting uses just
time.strftime()
function, and the formatter for it, defined insimples3.util.rfc822_fmt
, is'%a, %d %b %Y %H:%M:%S GMT'
. According to the documentation oftime.strftime()
:As a result, the current RFC 822 formatting is broken in non-US locale (e.g.
ko_KR
,ja_JP
). You can reproduce it easily:This bug also produces incorrect signatures (used for AWS authentication).