推荐学习书目
› 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 · Feb 22, 2015 · 5327 views
    This topic created in 4287 days ago, the information mentioned may be changed or developed.

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

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

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

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

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

    OMG。

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

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

    @msg7086 没错,弄个workaround即可
    bombless
    bombless
    Feb 22, 2015
    14
    这是用bug来逼你们升到3的节奏啊
    xfspace
    xfspace
    Feb 22, 2015 via Android
    15
    @bombless 那M$不给xp打补丁呢。。。:(逃
    bombless
    bombless
    Feb 22, 2015
    16
    @xfspace 所以m$也在用bug逼你升新版!
    ehs2013
    ehs2013
    Feb 23, 2015
    17
    下载 Python Mercurial 上最新 2.7 的源码编译一下看看吧,也许修复了也有可能。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4499 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 07:28 · PVG 15:28 · LAX 23:28 · JFK 02:28
    ♥ Do have faith in what you're doing.