[totem/wip/hadess/re-enable-pylint: 5/10] fixup! opensubtitles: Fix some pylint warnings




commit 8a056b2ce6c6c647f484b2489160265d19bb7c94
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jun 23 16:16:57 2022 +0200

    fixup! opensubtitles: Fix some pylint warnings

 src/plugins/opensubtitles/hash.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/opensubtitles/hash.py b/src/plugins/opensubtitles/hash.py
index 4a145b46d..f780519c5 100644
--- a/src/plugins/opensubtitles/hash.py
+++ b/src/plugins/opensubtitles/hash.py
@@ -21,7 +21,7 @@ def hash_file (name):
     if filesize < 65536 * 2:
         return SIZE_ERROR, 0
 
-    with file_handle = open (file_to_hash.get_path (), "rb"):
+    with open (file_to_hash.get_path (), "rb") as file_handle:
         for _ in range(int(65536 / bytesize)):
             buf = file_handle.read (bytesize)
             (l_value,) = struct.unpack (longlongformat, buf)
@@ -39,6 +39,6 @@ def hash_file (name):
             file_hash += l_value
             file_hash = file_hash & 0xFFFFFFFFFFFFFFFF
 
-    returnedhash = f"{file_hash:016x}"
+    returnedhash = f"{file_hash:%016x}"
 
     return returnedhash, filesize


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]