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

2015 年 2 月 22 日
 invite

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

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

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

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

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

OMG。

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

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

@msg7086 没错,弄个workaround即可
bombless
2015 年 2 月 22 日
这是用bug来逼你们升到3的节奏啊
xfspace
2015 年 2 月 22 日
@bombless 那M$不给xp打补丁呢。。。:(逃
bombless
2015 年 2 月 22 日
@xfspace 所以m$也在用bug逼你升新版!
ehs2013
2015 年 2 月 23 日
下载 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