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 588091 - gnome-schedule crashed on startup after upgrade frrom 2.02 to 2.1
gnome-schedule crashed on startup after upgrade frrom 2.02 to 2.1
Status: RESOLVED FIXED
Product: gnome-schedule
Classification: Other
Component: general
2.1.0
Other All
: Normal critical
: ---
Assigned To: GNOME Schedule Maintainers
GNOME Schedule Maintainers
: 600245 600267 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-07-08 15:54 UTC by Paul Hodges
Modified: 2009-11-01 00:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for 2.1.0 (460 bytes, patch)
2009-07-08 16:05 UTC, Paul Hodges
none Details | Review

Description Paul Hodges 2009-07-08 15:54:19 UTC
Steps to reproduce:
1. create a one time scheduled task in 2.02
2. uninstall 2.02 and install 2.1
3. start up gnome-schedule


Stack trace:
Traceback (most recent call last):  File "/usr/local/share/gnome-schedule/gnome-schedule.py", line 74, in <module>
    mainWindow = mainWindow.main(debug_flag, False, pr, manual_poscorrect)
  • File "/usr/local/share/gnome-schedule/mainWindow.py", line 257 in __init__
    self.schedule_reload ()
  • File "/usr/local/share/gnome-schedule/mainWindow.py", line 304 in schedule_reload
    data = self.crontab.read ()
  • File "/usr/local/share/gnome-schedule/crontab.py", line 438 in read
    array_or_false = self.parse (line)
  • File "/usr/local/share/gnome-schedule/crontab.py", line 604 in parse
    success, ver, title, desc, output, display, command_d = self.get_job_data (job_id)
  • File "/usr/local/share/gnome-schedule/crontab.py", line 690 in get_job_data
    return True, ver, title, desc, output, display, command_d
UnboundLocalError: local variable 'display' referenced before assignment


Other information:
i was able to fix this bug by adding this to line 645 of crontab.py:
            display = 0
            command_d = ""

sorry I have never created a patch file.
here is what my crontab file looked like

----------------------------------------
/root/.gnome/gnome-schedule/crontab/1
----------------------------------------
ver=3
title=Sync time
desc=
nooutput=1
----------------------------------------
Comment 1 Paul Hodges 2009-07-08 16:05:54 UTC
Created attachment 138049 [details] [review]
Patch for 2.1.0

here we are
Comment 2 Gaute Hope 2009-07-08 17:34:02 UTC
Thanks! I have committed a slightly modified version of your fix. 

Patches:
Since Gnome-schedule uses the git VCS the best to do is to do a clone of the repository and then use git format-patch to create a patch:

$ git clone git://git.gnome.org/gnome-schedule

do changes

$ git add files
$ git commit 

$ git format-patch -1 (-1 is for the last commit, use -2 if you have two commits - one is preferred) 

then your name will show up in the history of the commit and you'll get the credit :)

thanks, gaute
Comment 3 Paul Hodges 2009-07-08 18:30:38 UTC
i did notice one other issue .. theres a type mismatch (i haven't checked for an error or not but I just visually noticed it) .. 

at line 693 of crontab.py:

            return True, ver, title, desc, output, display, command_d
            
            
        else: 
            return False, "", "", "", 0, 0, ""


the return false has display as 0 (numeric) where it is a string above .. i don't really know python and i'm not sure how the type juggling works, but just an fyi
Comment 4 Gaute Hope 2009-07-09 06:34:00 UTC
(In reply to comment #3)
> at line 693 of crontab.py:
>             return True, ver, title, desc, output, display, command_d
>         else: 
>             return False, "", "", "", 0, 0, ""
> the return false has display as 0 (numeric) where it is a string above .. i
> don't really know python and i'm not sure how the type juggling works, but just
> an fyi

thanks! i'll fix that too!

- gaute

Comment 5 Gaute Hope 2009-07-09 11:56:31 UTC
Done! http://git.gnome.org/cgit/gnome-schedule/commit/?id=e0b8db2ec9fb54d72425e4cabc6aa52ee5fd8228

Got a bit mixed with whitespace cleanup, but should be right now. In fact the various wrong types never got used since the first False variable stopped any other functions using the results.

- gaute
Comment 6 Gaute Hope 2009-10-31 17:57:27 UTC
*** Bug 600245 has been marked as a duplicate of this bug. ***
Comment 7 Gaute Hope 2009-10-31 18:01:02 UTC
See launchpad bug: lp:419471 https://bugs.launchpad.net/ubuntu/+source/gnome-schedule/+bug/419471

The simple fix if you are not able to upgrade to the latest version is described there:

> [..] Just deleting the data files should make gnome-schedule use
> some default values. They are located in ~/.gnome/gnome-schedule/crontab> 
>
> $ cd ~/.gnome/gnome-schedule/crontab/ && rm *
>
> In case that doesn't work you could delete your entire crontab
> (scheduled recurrent tasks) with:
>
> $ crontab -d

- gaute
Comment 8 Fabio Durán Verdugo 2009-11-01 00:06:08 UTC
*** Bug 600267 has been marked as a duplicate of this bug. ***