Page 1 of 1

[minor bug] sab crashes when launched from within non-existing directory

Posted: December 22nd, 2010, 2:04 pm
by diedjee
Version: 0.5.6
OS: Ubuntu Linux (2.6.32-26-generic #48-Ubuntu SMP Wed Nov 24 09:00:03 UTC 2010 i686 GNU/Linux)
Install-type: linux repository
Skin: Smpl (n/a)
Firewall Software: None
Are you using IPV6? no
Is the issue reproducible? yes

When sabnzbd is started from the console from a deleted directory, the python command os.getcwd() throws an exception which isn't catched properly and causes sabnzbd to halt inproperly.

How to reproduce this error:

Code: Select all

> mkdir test
> cd test
> rm ../test
> sabnzbdplus &
The error displayed is the following:

Code: Select all

sh: getcwd() failed: No such file or directory
Traceback (most recent call last):
  File "/usr/bin/sabnzbdplus", line 1245, in <module>
    main()
  File "/usr/bin/sabnzbdplus", line 661, in main
    org_dir = os.getcwd()
OSError: [Errno 2] No such file or directory
Proposed solution:
catch the exception, display a warning and default the cwd to the home directory.
Or alternatively, halt the application in a nice way.

Re: [minor bug] sab crashes when launched from within non-existing directory

Posted: December 23rd, 2010, 2:59 am
by shypike
diedjee wrote: When sabnzbd is started from the console from a deleted directory
Thanks for the tip.
Quoting Steve Jobs: "Don't hold it like that".