After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 669478 - hamster-time-tracker crashed with TypeError: can't compare datetime.datetime to NoneType
hamster-time-tracker crashed with TypeError: can't compare datetime.datetime ...
Status: RESOLVED OBSOLETE
Product: hamster-applet
Classification: Deprecated
Component: general
2.91.x
Other Linux
: Normal normal
: ---
Assigned To: hamster-applet-maint
hamster-applet-maint
Depends on:
Blocks:
 
 
Reported: 2012-02-06 14:02 UTC by James Strandboge
Modified: 2012-09-24 23:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] if start_time is None, reset the selection and don't update the widget (1.27 KB, patch)
2012-02-06 15:31 UTC, James Strandboge
rejected Details | Review
[REAL PATCH] if start_time is None, reset the selection and don't update the widget (1.28 KB, patch)
2012-02-06 15:37 UTC, James Strandboge
rejected Details | Review
[REAL PATCHv2] if start_time is None, reset the selection and don't update the widget (1.21 KB, patch)
2012-02-06 15:57 UTC, James Strandboge
committed Details | Review

Description James Strandboge 2012-02-06 14:02:42 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):
  • File "/usr/lib/python2.7/dist-packages/hamster/widgets/dayline.py", line 186 in on_click
    if start_time > dt.datetime.now():
TypeError: can't compare datetime.datetime to NoneType"

Comment 1 James Strandboge 2012-02-06 14:46:29 UTC
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.
Comment 2 James Strandboge 2012-02-06 15:31:59 UTC
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.
Comment 3 James Strandboge 2012-02-06 15:36:08 UTC
Review of attachment 206901 [details] [review]:

oops, wrong patch! :)
Comment 4 James Strandboge 2012-02-06 15:37:53 UTC
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.
Comment 5 James Strandboge 2012-02-06 15:56:33 UTC
Review of attachment 206904 [details] [review]:

This patch has a harmless but redundant check.
Comment 6 James Strandboge 2012-02-06 15:57:49 UTC
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.
Comment 7 Toms Bauģis 2012-09-24 19:22:53 UTC
moved: https://github.com/projecthamster/hamster/issues/24
Comment 8 Toms Bauģis 2012-09-24 23:21:34 UTC
Review of attachment 206905 [details] [review]:

merged/pushed to master on github