From f3448ad08ebaf8d186a07ac9f5ae62f752842ad7 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 18 Jun 2018 00:50:47 +0000 Subject: [PATCH 41/54] Python 3 preparation: use string.ascii_letters instead of string.letters. --- roundup/password.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roundup/password.py b/roundup/password.py index 3686932..45c446d 100644 --- a/roundup/password.py +++ b/roundup/password.py @@ -178,7 +178,7 @@ def encodePassword(plaintext, scheme, other=None, config=None): if other is not None: salt = other else: - saltchars = './0123456789'+string.letters + saltchars = './0123456789'+string.ascii_letters salt = random.choice(saltchars) + random.choice(saltchars) s = crypt.crypt(plaintext, salt) elif scheme == 'plaintext': @@ -188,7 +188,7 @@ def encodePassword(plaintext, scheme, other=None, config=None): return s def generatePassword(length=12): - chars = string.letters+string.digits + chars = string.ascii_letters+string.digits password = [random.choice(chars) for x in range(length)] # make sure there is at least one digit password[0] = random.choice(string.digits) -- 2.7.4