Enforce length as an int, fixes #29107

This commit is contained in:
Loren Gordon 2015-11-22 10:21:08 -05:00
parent bb28b9186b
commit c71825d3b0

View file

@ -32,6 +32,7 @@ def secure_password(length=20):
'''
Generate a secure password.
'''
length = int(length)
pw = ''
while len(pw) < length:
if HAS_RANDOM: