mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 18:47:09 -07:00
make sure os.devnull is opened as writable.
This commit is contained in:
parent
405101b7a2
commit
0eadf394c1
2 changed files with 3 additions and 3 deletions
|
@ -334,7 +334,7 @@ def initialize(section=None):
|
|||
if REMOTEPATHS:
|
||||
REMOTEPATHS = [ tuple(item.split(',')) for item in REMOTEPATHS.split('|') ] # /volume1/Public/,E:\|/volume2/share/,\\NAS\
|
||||
|
||||
devnull = open(os.devnull)
|
||||
devnull = open(os.devnull, 'w')
|
||||
try:
|
||||
subprocess.Popen(["nice"], stdout=devnull, stderr=devnull).communicate()
|
||||
NICENESS.extend(['nice', '-n%s' % (int(CFG["Posix"]["niceness"]))])
|
||||
|
|
|
@ -43,7 +43,7 @@ def extract(filePath, outputDestination):
|
|||
}
|
||||
# Test command exists and if not, remove
|
||||
if not os.getenv('TR_TORRENT_DIR'):
|
||||
devnull = open(os.devnull)
|
||||
devnull = open(os.devnull, 'w')
|
||||
for cmd in required_cmds:
|
||||
if call(['which', cmd], stdout=devnull, stderr=devnull): #note, returns 0 if exists, or 1 if doesn't exist.
|
||||
if cmd == "7zr" and not call(["which", "7z"]): # we do have "7z" command
|
||||
|
@ -89,7 +89,7 @@ def extract(filePath, outputDestination):
|
|||
|
||||
pwd = os.getcwd() # Get our Present Working Directory
|
||||
os.chdir(outputDestination) # Not all unpack commands accept full paths, so just extract into this directory
|
||||
devnull = open(os.devnull)
|
||||
devnull = open(os.devnull, 'w')
|
||||
try: # now works same for nt and *nix
|
||||
cmd.append(filePath) # add filePath to final cmd arg.
|
||||
if platform.system() != 'Windows':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue