From 9d5524831a16963c805cd38a49c7f04dfe16d3ea Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Tue, 30 Aug 2016 08:30:30 +0200 Subject: [PATCH] Remove problematic characters. fix #898 --- modoboa/lib/cryptutils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modoboa/lib/cryptutils.py b/modoboa/lib/cryptutils.py index 74c1e2657..c98ebff1a 100644 --- a/modoboa/lib/cryptutils.py +++ b/modoboa/lib/cryptutils.py @@ -16,7 +16,8 @@ def random_key(l=16): :param integer l: the key's length :return: a string """ - population = string.digits + string.letters + string.punctuation + punctuation = """!#$%&'()*+,-./:;<=>?@[]^_`{|}~""" + population = string.digits + string.letters + punctuation while True: key = "".join(random.sample(population * l, l)) if len(key) == l: