Commits

Thomas Figg committed e2c8b74

removing no-op code, adding filename check

  • Participants
  • Parent commits 4aee746

Comments (0)

Files changed (1)

hanzo/warctools/stream.py

             if offset is not None:
                 file_handle.seek(offset)
                 
-    else:
-        if not filename:
-            filename = file_handle.name
-
     if record_class == None:
         record_class = guess_record_type(file_handle)
 
     record_parser = record_class.make_parser()
 
     if gzip == 'auto':
-        if is_gzip_file(file_handle):
+        if (filename and filename.endswith('.gz')) or is_gzip_file(file_handle):
             gzip = 'record'
             #debug('autodetect: record gzip')
         else: