Message123639
On Wed, Dec 8, 2010 at 1:50 PM, Hirokazu Yamamoto
<report@bugs.python.org> wrote:
..
> I got readable result. ;-)
>
You mean readable to *you*. :-)
>>>> import time
>>>> time.tzname
> ('東京 (標準時)', '東京 (標準時)')
This makes sense now. There are two issues here:
1. Decoding the output of wcsftime(). Python expects mbcs (which I
believe is an UTF16-like wide char encoding) while Windows apparently
puts cp932 there in your locale. I don't have expertise to address
this issue.
2. strptime() cannot parse strftime() output when strftime('%Z') is
different from time.tzname[dst]. This issue we can address. Note
that for most of the locale information such as day of the week or
month names, strptime() relies on strftime() output, so the
round-tripping should work even when strftime() results are
nonsensical. On the other hand, tz spellings are taken from
time.tzname. I think we can make strptime() more robust by adding
[time.strftime('%Z', (2000,1,1,0,0,0,0,0,dst) for dst in (0,1)] to the
list of recognized tz names if they differ from time.tzname. |
|
| Date |
User |
Action |
Args |
| 2010-12-08 19:45:38 | belopolsky | set | recipients:
+ belopolsky, ocean-city, brian.curtin |
| 2010-12-08 19:45:36 | belopolsky | link | issue10653 messages |
| 2010-12-08 19:45:36 | belopolsky | create | |
|