diff --git a/libarchive/__init__.py b/libarchive/__init__.py index 4ff6b14..985bac4 100644 --- a/libarchive/__init__.py +++ b/libarchive/__init__.py @@ -117,7 +117,10 @@ def get_func(name, items, index): def guess_format(filename): - filename, ext = os.path.splitext(filename) + if isinstance(filename, int): + filename = ext = '' + else: + filename, ext = os.path.splitext(filename) filter = FILTER_EXTENSIONS.get(ext) if filter: filename, ext = os.path.splitext(filename)