From ff826320ca4a4d2bbd17a4aac0c307840941a75c Mon Sep 17 00:00:00 2001 From: Antonio Ospite Date: Mon, 19 Sep 2011 12:13:29 +0200 Subject: [PATCH] Add some debug print when the filename could not be guessed --- winfreed.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/winfreed.py b/winfreed.py index c465b63..b9da36e 100755 --- a/winfreed.py +++ b/winfreed.py @@ -59,10 +59,15 @@ def download(entry): response = urllib2.urlopen(url) filename = urllib2.unquote(os.path.basename(response.geturl())) + if filename == "": + sys.stderr.write("Debug (%s): filename: %s url: %s\n" %(entry['package'], filename, response.geturl())) + return + destfile = os.path.join(OUTPUT_DIR, filename) if os.path.exists(destfile): - sys.stderr.write("Warning: %s exists!\n" % destfile) + sys.stderr.write("Warning (%s): %s exists!\n" % (entry['package'], destfile)) return + outfile = open(destfile, mode='w') total_size = response.info().getheader('Content-Length').strip() -- 2.1.4