This commit is contained in:
Kovid Goyal 2008-05-18 07:16:40 -07:00
parent cbf7c8bf8c
commit c3fecac479

View File

@ -250,7 +250,10 @@ class RecursiveFetcher(object, LoggingInterface):
self.log_debug('Error: %s', str(err), exc_info=True) self.log_debug('Error: %s', str(err), exc_info=True)
continue continue
c += 1 c += 1
imgpath = os.path.join(diskpath, sanitize_file_name('img'+str(c)+ext)) fname = sanitize_file_name('img'+str(c)+ext)
if isinstance(fname, unicode):
fname = fname.encode('ascii', 'replace')
imgpath = os.path.join(diskpath, fname)
with self.imagemap_lock: with self.imagemap_lock:
self.imagemap[iurl] = imgpath self.imagemap[iurl] = imgpath
open(imgpath, 'wb').write(f.read()) open(imgpath, 'wb').write(f.read())