rrule brocken when cache used by using _thread module in Python2
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| dateutil |
Fix Released
|
Undecided
|
Unassigned | ||
| python-dateutil (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
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/
super(rrule, self)._
File "/usr/local/
self.
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.
| Changed in dateutil: | |
| status: | New → Fix Released |
| Changed in python-dateutil (Ubuntu): | |
| status: | New → Fix Released |
Reproducible by, for example:
from dateutil.rrule import rrule, DAILY
list(rrule(DAILY, count=7, cache=True)