[0.2.3->0.2.4 regression] date parsing crash in __cmp__(): AttributeError: 'str' object has no attribute 'to_py_date'

Bug #561449 reported by Jeff Fortin Tam
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
GTG
Fix Released
High
Luca Invernizzi
gtg (Ubuntu)
Fix Released
High
Luca Invernizzi

Bug Description

French version of gtg.
Regression in 0.2.4 from 0.2.3.

Try creating the following tasks:

test due:now
test due:maintenant

In the first case, nothing happens when you press enter (it used to work fine). Same thing for due:soon. due:demain works though.
In the second case, you get a traceback:

Traceback (most recent call last):
  File "/usr/share/gtg/GTG/taskbrowser/browser.py", line 1352, in on_quickadd_activate
    due_date = self.get_canonical_date(args)
  File "/usr/share/gtg/GTG/taskbrowser/browser.py", line 825, in get_canonical_date
    if date == str(no_date):
  File "/usr/share/gtg/GTG/tools/dates.py", line 31, in __cmp__
    return cmp(self.to_py_date(), other.to_py_date())
AttributeError: 'str' object has no attribute 'to_py_date'

Revision history for this message
Bryce Harrington (bryce) wrote :

From dupe bug:

"""
Happened when tried to add "Test4 due:05-06-2010" in quick add.

Traceback (most recent call last):
  File "/usr/share/gtg/GTG/taskbrowser/browser.py", line 1352, in on_quickadd_activate
    due_date = self.get_canonical_date(args)
  File "/usr/share/gtg/GTG/taskbrowser/browser.py", line 825, in get_canonical_date
    if date == str(no_date):
  File "/usr/share/gtg/GTG/tools/dates.py", line 31, in __cmp__
    return cmp(self.to_py_date(), other.to_py_date())
AttributeError: 'str' object has no attribute 'to_py_date'
"""

Changed in gtg (Ubuntu):
importance: Undecided → High
milestone: none → lucid-updates
status: New → Triaged
summary: - date parsing broke
+ [0.2.3->0.2.4 regression] date parsing crash in __cmp__():
+ AttributeError: 'str' object has no attribute 'to_py_date'
Revision history for this message
Luca Invernizzi (invernizzi) wrote :

I should have fixed that. Please test it with your locale (as I have installed localepurge, which has its downsides)

Changed in gtg:
status: New → Triaged
Changed in gtg (Ubuntu):
status: Triaged → Fix Committed
Changed in gtg:
importance: Undecided → High
status: Triaged → Fix Committed
assignee: nobody → Luca Invernizzi (invernizzi)
Changed in gtg (Ubuntu):
assignee: nobody → Luca Invernizzi (invernizzi)
Changed in gtg:
milestone: none → 0.3
Changed in gtg:
milestone: 0.3 → 0.2.9
Revision history for this message
Jeff Fortin Tam (kiddo) wrote :

Sorry, but I'm still seeing this today with bzr rev 985. due:maintenant or due:demain does not get parsed at all...

Changed in gtg:
status: Fix Committed → New
Changed in gtg (Ubuntu):
status: Fix Committed → New
Revision history for this message
Jeff Fortin Tam (kiddo) wrote :

...but there is no traceback.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gtg (Ubuntu):
status: New → Confirmed
Revision history for this message
Paul Kenyon (rixoff) wrote :

I have a similar problem in version 0.2.4 in Ubunto Oneiric. I'm using US-English stuff. Looks like you need an exception handler for dates that don't have a known value?

Revision history for this message
Izidor Matušov (izidor) wrote :

Jean-François > to get translated due date, you have to use translation. Due dates are translated (and recognized) only if it is in English or in the locale you use.

For example, i can use "due:soon" and "due:bald" while I use German locales. I am not able to use "due:maintenant"

Paul > the problem was fixed in the latest source code.

Changed in gtg:
status: New → Fix Committed
Changed in gtg (Ubuntu):
status: Confirmed → Fix Committed
Izidor Matušov (izidor)
Changed in gtg:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gtg - 0.2.9-1

---------------
gtg (0.2.9-1) unstable; urgency=low

  * New upstream release (Closes: #668096).
    - Implement a search text box (Closes: #650279).
    - Window title reflects active tasks (LP: #537096).
    - Fix misbehaviours of the indicator applet (LP: #548836, #676353).
    - Fix crash when selecting notification area plugin twice (LP: #550321).
    - Fix sorting of tasks by date (LP: #556159).
    - Fix excessive delays at startup (LP: #558600).
    - Fix crash with dates having unknown values (LP: #561449).
    - Fix crash issued when pressing delete key (LP: #583103).
    - Keep notification plugin enabled after logoff (LP: #617257).
    - Fix Hamster plugin to work with recent Hamster versions (LP: #620313).
    - No longer use non-unicode strings (LP: #680632).
    - New RTM sync mechanism (LP: #753327).
    - Fix crashes while handling XML storage file (LP: #916474, #917634).
  * debian/patches/*:
    - Drop all patches, they have been merged upstream.
  * debian/patches/shebang.patch:
    - Fix shebang line.
  * debian/patches/manpages.patch:
    - Fix some groff warnings in gtg_new_task man page
  * debian/compat:
    - Bump compatibility level to 9.
  * debian/control:
    - Bump X-Python-Version to >= 2.6.
    - Add python-liblarch and python-liblarch-gtk to Depends field.
    - Add python-cheetah, python-geoclue, python-gnomekeyring,
      python-launchpadlib and python-suds to Suggests field.
    - Bump Standards-Version to 3.9.3.
  * debian/copyright:
    - Refresh copyright information.
    - Format now points to copyright-format site.
  * debian/rules:
    - Make gtcli_bash_completion script executable.
  * debian/watch:
    - Update watch file.

 -- Luca Falavigna <email address hidden> Tue, 10 Apr 2012 23:08:21 +0200

Changed in gtg (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.