V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
invite
V2EX  ›  Python

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

  •  
  •   invite · 2015-02-22 20:53:58 +08:00 · 4224 次点击
    这是一个创建于 3344 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

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

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

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

    OMG。

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

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

    @msg7086 没错,弄个workaround即可
    bombless
        14
    bombless  
       2015-02-22 23:14:27 +08:00
    这是用bug来逼你们升到3的节奏啊
    xfspace
        15
    xfspace  
       2015-02-22 23:22:22 +08:00 via Android
    @bombless 那M$不给xp打补丁呢。。。:(逃
    bombless
        16
    bombless  
       2015-02-22 23:50:25 +08:00
    @xfspace 所以m$也在用bug逼你升新版!
    ehs2013
        17
    ehs2013  
       2015-02-23 02:20:37 +08:00
    下载 Python Mercurial 上最新 2.7 的源码编译一下看看吧,也许修复了也有可能。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2968 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 03:25 · PVG 11:25 · LAX 20:25 · JFK 23:25
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.