From 5c31f511f677a6ba04271e9fc81bb5abdffd5400 Mon Sep 17 00:00:00 2001 From: Bas Stottelaar Date: Thu, 27 Nov 2014 01:50:32 +0100 Subject: [PATCH] Log exact write check error to log (debug) --- headphones/postprocessor.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/headphones/postprocessor.py b/headphones/postprocessor.py index 4de9de5d..f02938e8 100755 --- a/headphones/postprocessor.py +++ b/headphones/postprocessor.py @@ -329,9 +329,10 @@ def doPostProcessing(albumid, albumpath, release, tracks, downloaded_track_list, headphones.CONFIG.MOVE_FILES: try: - with open(downloaded_track, "a+b"): - pass - except IOError: + with open(downloaded_track, "a+b") as fp: + fp.seek(0) + except IOError as e: + logger.debug("Write check exact error: %s", e) logger.error("Track file is not writeable. This is required " \ "for some post processing steps: %s. Not continuing.", downloaded_track.decode(headphones.SYS_ENCODING, "replace"))