White scenery @showyou, hatena

If you have any comments, you may also send twitter @shsub or @showyou.

理解不能なstrptimeのエラー

File "/home/hoge/toDate.py", line 19, in toDate
    dates = time.strptime(date,str)
  File "/usr/lib/python2.5/_strptime.py", line 330, in strptime
    (data_string, format))
ValueError: time data did not match format:  data=Thu Jan 22 05:19:28 +0000 2009  fmt=%a %b %d %H:%M:%S +0000 %Y
hoge@foo:~/$ python
Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> time.strptime("Thu Jan 22 05:19:28 +0000 2009","%a %b %d %H:%M:%S +0000 %Y")
(2009, 1, 22, 5, 19, 28, 3, 22, -1)

なんでやねん。

考えられることとしては

  1. 表示は同じに見えても文字コードとか違う
  2. 変数に入れるときになんか処理されてる

追記

同じファイルから元の関数を呼び出したら問題なく動く。
引数一緒で別のファイルからimportして呼び出すとなぜかValueErrorが起きる。ナニコレ。

追記

Macでこのソース動かしたらちゃんと動くし・・なんだこれ。