]> git.phdru.name Git - dotfiles.git/blobdiff - bin/unzip.py
Feat(bin): Port scripts to Python 3
[dotfiles.git] / bin / unzip.py
index 8fd74266b4980068adb4028afd45d2dd8f38fbdd..e88e5265a5504d69949ec375d348845424f33e1d 100755 (executable)
@@ -1,7 +1,7 @@
-#! /usr/bin/env python
+#! /usr/bin/env python3
 """Unzip with encoded filenames
 
-   Written by Oleg Broytman. Copyright (C) 2009-2016 PhiloSoft Design.
+   Written by Oleg Broytman. Copyright (C) 2009-2023 PhiloSoft Design.
 """
 
 import sys, os, time
@@ -28,7 +28,9 @@ for zinfo in zf.infolist():
     path = zinfo.filename
     if isinstance(path, bytes):
         path = path.decode('cp866')
-    recoded_path = path.encode(default_encoding)
+        recoded_path = path.encode(default_encoding)
+    else:
+        recoded_path = path
     print(recoded_path)
 
     if path.startswith('./'):