Mercurial > p > roundup > code
diff roundup/password.py @ 5415:2d6a92c3e212
Python 3 preparation: use string.ascii_letters instead of string.letters.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Wed, 25 Jul 2018 00:40:26 +0000 |
| parents | 3fa026621f69 |
| children | 56c9bcdea47f |
line wrap: on
line diff
--- a/roundup/password.py Wed Jul 25 00:39:37 2018 +0000 +++ b/roundup/password.py Wed Jul 25 00:40:26 2018 +0000 @@ -178,7 +178,7 @@ 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 @@ 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)
