You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.
Haven't read through the code to get to the bottom of this (db.py/rars.py), but just had a situation where unrar was set incorrectly and my tmp dir filled with rars as they were not getting deleted.
Will investigate when I can.
The text was updated successfully, but these errors were encountered:
I had a look, this is caused by a missed cleanup in pynab/rars.py::get_rar_info().
The actual rar temp file is written early with this:
# if we got the requested articles, save them to a temp rar
t = None
with tempfile.NamedTemporaryFile('wb', suffix='.rar', delete=False) as t:
t.write(data.encode('ISO-8859-1'))
t.flush()
Then a little later we do this:
unrar_path = config.postprocess.get('unrar_path', '/usr/bin/unrar')
if not (unrar_path and os.path.isfile(unrar_path) and os.access(unrar_path, os.X_OK)):
log.error('rar: skipping archive decompression because unrar_path is not set or incorrect')
log.error(
'rar: if the rar is not password protected, but contains an inner archive that is, we will not know')
else:
Other error paths issue an os.remove(t.name) before returning.
It's probably cleanest to fix this by moving the 'unrar_path' checking all the way to the start of the function and bailing early. There's no point in saving the rar if we have no unrar to process it.
Haven't read through the code to get to the bottom of this (db.py/rars.py), but just had a situation where unrar was set incorrectly and my tmp dir filled with rars as they were not getting deleted.
Will investigate when I can.
The text was updated successfully, but these errors were encountered: