GNOME Bugzilla – Bug 669478
hamster-time-tracker crashed with TypeError: can't compare datetime.datetime to NoneType
Last modified: 2012-09-24 23:21:34 UTC
Forwarded from https://launchpad.net/bugs/926481: "I was fooling around on precise with hamster 2.91.3+git20110714.9aefd7-2ubuntu2 I started and stopped a few tasks, then edited one, dragging the graphical extent to make it start earlier, as I recall. I might have done other stuff too. Then it crashed and offered to send in a bug report, so I said yes. Here it is. This was in the terminal window where I started it. /usr/lib/python2.7/dist-packages/hamster/configuration.py:153: GtkWarning: IA__gtk_accel_label_set_accel_closure: assertion `gtk_accel_group_from_accel_closure (accel_closure) != NULL' failed ui.add_from_file(os.path.join(runtime.data_dir, name)) Traceback (most recent call last):
+ Trace 229615
if start_time > dt.datetime.now():
I can confirm this. The way to reproduce seems to be to modify an entry, then click/drag on the range bar, then go left to right such that the times are the same, then unclick.
Created attachment 206901 [details] [review] [PATCH] if start_time is None, reset the selection and don't update the widget This patch works well. We don't want to set start_time to a default value otherwise the range doesn't get calculated properly. This patch was tested with various ranges above and below the current range as well as large and small increments going left to right and right to left.
Review of attachment 206901 [details] [review]: oops, wrong patch! :)
Created attachment 206904 [details] [review] [REAL PATCH] if start_time is None, reset the selection and don't update the widget This patch works well. We don't want to set start_time to a default value otherwise the range doesn't get calculated properly. This patch was tested with various ranges above and below the current range as well as large and small increments going left to right and right to left.
Review of attachment 206904 [details] [review]: This patch has a harmless but redundant check.
Created attachment 206905 [details] [review] [REAL PATCHv2] if start_time is None, reset the selection and don't update the widget Sorry for the patch noise. Here is the real patch, tested in the same manner as the other one.
moved: https://github.com/projecthamster/hamster/issues/24
Review of attachment 206905 [details] [review]: merged/pushed to master on github