Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improved error handling reading autoProcess conf

read() was being used which will not generate an error and cause a hard to understand crash later on when trying to read something from the configuration file. This could happen if the file existed, but the permission(s) weren't okay.
  • Loading branch information...
commit c3b5ac687f0decc119d36e79a06f1b229c75387d 1 parent b3a7afe
@SerhatG SerhatG authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 autoProcessTV/autoProcessTV.py
View
8 autoProcessTV/autoProcessTV.py
@@ -51,7 +51,13 @@ def processEpisode(dirName, nzbName=None):
print "ERROR: You need an autoProcessTV.cfg file - did you rename and edit the .sample?"
sys.exit(-1)
- config.read(configFilename)
+ try:
+ fp = open(configFilename, "r")
+ config.readfp(fp)
+ fp.close()
+ except IOError, e:
+ print "Could not read configuration file: ", str(e)
+ sys.exit(1)
host = config.get("SickBeard", "host")
port = config.get("SickBeard", "port")
Please sign in to comment.
Something went wrong with that request. Please try again.