Python 的 BUG 是不是一直不修复的?

2015-02-22 20:53:58 +08:00
 invite

今天写了个代码,然后报错:

AttributeError: 'module' object has no attribute '_strptime_time'

然后网上搜了下,说是多线程的BUG。

于是升级了Python到最新版: 2.7.9

结果运行后,还是同样的报错。

OMG。

难道Python的BUG都不修复的? 还是其他原因导致的报错?

4235 次点击
所在节点    Python
17 条回复
xcv58
2015-02-22 21:05:28 +08:00
你确定最新版 Python 是 2.7.9
evlos
2015-02-22 21:09:02 +08:00
这不是 bug 吧
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. **
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.
evlos
2015-02-22 21:14:15 +08:00
@pandada8 刚才有事走开了一下 回来再回复就看到你已经先贴了 /w\
aaaa007cn
2015-02-22 21:16:47 +08:00
pandada8
2015-02-22 21:17:53 +08:00
@evlos 是的~
@invite 值得注意的是 3.3 以后 import 机制有些变化所以 **最新的** Python3.4 和比较**新**的 python 3.3 没有这个问题
aaaa007cn
2015-02-22 21:24:14 +08:00
@evlos 我点开帖子的时候也只有一个回复啊 ww
invite
2015-02-22 21:57:33 +08:00
@xcv58 是啊,出问题了,搜了一下,然后从官网down了最新版的 python -V 也显示 2.7.9 了。
msg7086
2015-02-22 22:09:56 +08:00
@invite 你怎么down的?确定抓的3系?
invite
2015-02-22 22:11:44 +08:00
@msg7086 我没升到3,升到2的最新版。
msg7086
2015-02-22 22:15:16 +08:00
@invite 2本身就不是最新版,不修bug不奇怪。何况这也不是大问题,完全可以用非常小的patch来避免。
caizixian
2015-02-22 22:21:36 +08:00
@invite 没有历史包袱的project全升到3

@msg7086 没错,弄个workaround即可
bombless
2015-02-22 23:14:27 +08:00
这是用bug来逼你们升到3的节奏啊
xfspace
2015-02-22 23:22:22 +08:00
@bombless 那M$不给xp打补丁呢。。。:(逃
bombless
2015-02-22 23:50:25 +08:00
@xfspace 所以m$也在用bug逼你升新版!
ehs2013
2015-02-23 02:20:37 +08:00
下载 Python Mercurial 上最新 2.7 的源码编译一下看看吧,也许修复了也有可能。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/172200

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX