about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2020-07-08 22:06:49 +0200
committertoonn <toonn@toonn.io>2020-07-08 22:06:49 +0200
commite13536cd38ac86ea66f1fddadf3a9cfa15a1630f (patch)
tree913a1e9dad808d33e1306146095afb66152e184f /ranger
parentf9e0a77f6711ba111b15fcbfa58d7d84d0804232 (diff)
downloadranger-e13536cd38ac86ea66f1fddadf3a9cfa15a1630f.tar.gz
Fix check for None
`not inode` would fail if the inode happened to be 0. Switched from
appending to prepending the inode to avoid appending to long strings.
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index f2a52451..b100c16c 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -1048,10 +1048,10 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
 
     @staticmethod
     def sha512_encode(path, inode=None):
-        if not inode:
+        if inode is None:
             inode = stat(path).st_ino
         sha = sha512(
-            os.path.join(path, str(inode)).encode('utf-8','backslashescape')
+            "{0}{1}".format(path, str(inode)).encode('utf-8', 'backslashescape')
         )
         return '{0}.jpg'.format(sha.hexdigest())