File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -446,7 +446,16 @@ def file_path_to_url(path: str) -> str:
446
446
return urljoin ("file:" , pathname2url (path ))
447
447
448
448
449
- _extension_to_compression = {".gz" : "gzip" , ".bz2" : "bz2" , ".zip" : "zip" , ".xz" : "xz" }
449
+ _extension_to_compression = {
450
+ ".tar" : "tar" ,
451
+ ".tar.gz" : "tar" ,
452
+ ".tar.bz2" : "tar" ,
453
+ ".tar.xz" : "tar" ,
454
+ ".gz" : "gzip" ,
455
+ ".bz2" : "bz2" ,
456
+ ".zip" : "zip" ,
457
+ ".xz" : "xz" ,
458
+ }
450
459
_supported_compressions = set (_extension_to_compression .values ())
451
460
452
461
@@ -522,9 +531,6 @@ def infer_compression(
522
531
# Cannot infer compression of a buffer, assume no compression
523
532
return None
524
533
525
- if ".tar" in filepath_or_buffer :
526
- return "tar"
527
-
528
534
# Infer compression from the filename/URL extension
529
535
for extension , compression in _extension_to_compression .items ():
530
536
if filepath_or_buffer .lower ().endswith (extension ):
You can’t perform that action at this time.
0 commit comments