From 5cdb1217074fd86650a33c5e3fd7b605cae40d07 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 25 Jan 2024 20:21:40 +0300 Subject: [PATCH] bin: Fix `unzip.py` --- bin/unzip.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/unzip.py b/bin/unzip.py index dd0a79f..57af7b1 100755 --- a/bin/unzip.py +++ b/bin/unzip.py @@ -1,7 +1,7 @@ #! /usr/bin/env python3 """Unzip with encoded filenames - Written by Oleg Broytman. Copyright (C) 2009-2023 PhiloSoft Design. + Written by Oleg Broytman. Copyright (C) 2009-2024 PhiloSoft Design. """ import sys, os, time @@ -27,10 +27,9 @@ out = '.' 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.decode('cp866').encode(default_encoding) else: - recoded_path = path.encode('cp437').decode('cp866') + recoded_path = path print(recoded_path) if path.startswith('./'): -- 2.39.5