[Bug 1378220] Re: rrule brocken when cache used by using _thread module in Python2

SteffenOschatz steffen.oschatz at gmail.com
Tue Oct 7 09:12:10 UTC 2014


I thought that there maybe are no tests for it - but they are.
Running test.py with python 2.7.6 also shows these errors beside others (TZTest).
But while running tox, only the failed TZTests are shown. 
So these maybe is the reason why it was not detected while it was introduced already 2/3 years ago.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python-dateutil in Ubuntu.
https://bugs.launchpad.net/bugs/1378220

Title:
  rrule brocken when cache used by using _thread module in Python2

Status in python-dateutil:
  New
Status in “python-dateutil” package in Ubuntu:
  New

Bug description:
  Upgraded Ubuntu from 12.04 to 14.04, so a new version was installed (Version: 1.5+dfsg-1ubuntu1) and I assume a new Python version too (2.7.6) .
  With the new versions following traceback appears:

      dates = list(rrule(DAILY, count=count, dtstart=now(tz), cache=True))
    File "/usr/local/lib/python2.7/dist-packages/dateutil/rrule.py", line 239, in __init__
      super(rrule, self).__init__(cache)
    File "/usr/local/lib/python2.7/dist-packages/dateutil/rrule.py", line 90, in __init__
      self._cache_lock = _thread.allocate_lock()
  AttributeError: 'module' object has no attribute 'allocate_lock'

  Tracked it down to the cache parameter.
  Last known working version seems to be 1.5 , so all following versions are broken too up to the newest (2.2).

  If I should guess, than these import of the _thread was introduced for Python3 - right ?
  But the problem is: these module is also available in Python2 - at least in the 2.7.6 where there is no  'allocate_lock' .

  So the "optimistic" try/except approach regarding of the import of the
  thread module should be replaced with a version check or attribute
  check instead.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dateutil/+bug/1378220/+subscriptions



More information about the foundations-bugs mailing list