From fd6611743b0a60b16c90e21dbf29f0870e2951c6 Mon Sep 17 00:00:00 2001 From: JoeLametta Date: Tue, 23 Oct 2018 08:00:00 +0000 Subject: [PATCH] Amend previous commit The comment included a typo and, using 'max' as variable name, I was accidentally shadowing Python's builtin 'max' function --- whipper/common/common.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/whipper/common/common.py b/whipper/common/common.py index 853204b..fa3a4ae 100644 --- a/whipper/common/common.py +++ b/whipper/common/common.py @@ -161,10 +161,10 @@ def truncate_filename(path): """ p, f = os.path.split(os.path.normpath(path)) f, e = os.path.splitext(f) - fn_lim = os.pathconf(p, 'PC_NAME_MAX') # max filenmae length in bytes - max = fn_lim - len(e.encode('utf-8')) + fn_lim = os.pathconf(p, 'PC_NAME_MAX') # max.filename length in bytes + f_max = fn_lim - len(e.encode('utf-8')) f = unicodedata.normalize('NFC', f) - f_trunc = unicode(f.encode('utf-8')[:max], 'utf-8', errors='ignore') + f_trunc = unicode(f.encode('utf-8')[:f_max], 'utf-8', errors='ignore') return os.path.join(p, f_trunc + e)