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

Report & discuss bugs found in SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
diedjee
Newbie
Newbie
Posts: 9
Joined: December 22nd, 2010, 1:33 pm

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

Post 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.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

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

Post 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".
Post Reply