今天写了个代码,然后报错:
AttributeError: 'module' object has no attribute '_strptime_time'
然后网上搜了下,说是多线程的BUG。
于是升级了Python到最新版: 2.7.9
结果运行后,还是同样的报错。
OMG。
难道Python的BUG都不修复的? 还是其他原因导致的报错?
1
xcv58 2015-02-22 21:05:28 +08:00 via iPhone
你确定最新版 Python 是 2.7.9
|
2
evlos 2015-02-22 21:09:02 +08:00
这不是 bug 吧
|
3
pandada8 2015-02-22 21:09:47 +08:00
http://bugs.python.org/issue7980
貌似是没修 Thread safety: The use of strptime is thread safe, but with one important caveat. The first use of strptime is not thread safe because the first use will import _strptime. That import is not thread safe and may throw AttributeError or ImportError. To avoid this issue, ** import _strptime explicitly before starting threads, or call strptime once before starting threads. ** |
4
evlos 2015-02-22 21:12:57 +08:00
引用 http://bugs.python.org/issue7980
>> Thread safety: The use of strptime is thread safe, but with one important caveat. The first use of strptime is not thread safe because the first use will import _strptime. That import is not thread safe and may throw AttributeError or ImportError. To avoid this issue, import _strptime explicitly before starting threads, or call strptime once before starting threads. |
6
aaaa007cn 2015-02-22 21:16:47 +08:00
|
7
pandada8 2015-02-22 21:17:53 +08:00
|
12
msg7086 2015-02-22 22:15:16 +08:00 via iPhone
@invite 2本身就不是最新版,不修bug不奇怪。何况这也不是大问题,完全可以用非常小的patch来避免。
|
14
bombless 2015-02-22 23:14:27 +08:00
这是用bug来逼你们升到3的节奏啊
|
17
ehs2013 2015-02-23 02:20:37 +08:00
下载 Python Mercurial 上最新 2.7 的源码编译一下看看吧,也许修复了也有可能。
|