launchpad-service-status can't compare datetime.datetime to NoneType
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-launchpadlib-toolkit (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Precise |
Fix Released
|
High
|
Unassigned | ||
Quantal |
Fix Released
|
High
|
Unassigned |
Bug Description
[Impact]
The launchpad-
lpltk clients use this tool to determine whether they will fail if they attempt to run.
One of the things the tool does to achieve this is to check the Launchpad blog for planned outages. However, if there are no planned outages listed in the feed, the tool fails due to undefined values.
[Development Fix]
The 2.x development series includes a fix that checks the results of the blog screenscraping before attempting to use it. This 2.0 branch is uploaded to quantal.
[Stable Fix]
The same fix applies on the 1.x stable series, which is being proposed for precise.
Note that with this change we're bumping the number from 0.5 to 1.0, to indicate the package is now released and considered stable. See package changelog for other changes (mainly fixes to unreported bugs) included in this release.
[Test Case]
1. Install package
2. launchpad-
Broken Behavior:
$ launchpad-
Traceback (most recent call last):
File "/usr/local/
if datetime.now() > outage_start and datetime.now() < outage_end:
TypeError: can't compare datetime.datetime to NoneType
Fixed Behavior:
$ ./scripts/
UP READWRITE
[Regression Potential]
This particular change just adds a check for None values before using them, it's unlikely to cause a regression.
There are some other changes included in 1.0, all of which are believed safe but the quantity of code changed means regressions are always possible. I feel this is a negligible risk though, because two of the bug fixes included in 1.0 address API changes in Launchpad that occurred a few months ago, and scripts written using the current (0.5) lpltk simply won't work.
As per UDS decisions, we're trying to shift into a more normal release process. However to date, most users of lpltk that I'm aware of install and run from bzr due to problems such as those mentioned above. We're hoping by being more aggressive at getting those kinds of fixes through SRU, we can gain better maintenance updates going so people don't need to run from bzr. So although this release contains some extra changes, I think they're needed, and going forward we're going to be more cherrypicky.
[Original Report]
/usr/bin/
Traceback (most recent call last):
File "/usr/bin/
if datetime.now() > outage_start and datetime.now() < outage_end:
TypeError: can't compare datetime.datetime to NoneType
A quick look at the code shows that this tool is based on screen scrapping
the launchpad notification feed
http://
and is coming up empty.
description: | updated |
description: | updated |
Changed in python-launchpadlib-toolkit (Ubuntu Quantal): | |
status: | New → Fix Released |
importance: | Undecided → High |
Changed in python-launchpadlib-toolkit (Ubuntu Precise): | |
importance: | Undecided → High |
status: | New → Fix Committed |
description: | updated |
The python- launchpadlib- toolkit upload in the queue contains significant changes not mentioned in the changelog - the addition of a fix_time function, among other things.
If those are intended please reupload with an expanded changelog, or if not please upload without those changes.
Also, the diff contains the removal of the build tree which was apparently included in the previous upload. That's annoying but I won't reject it for that.