From e51fae3784ad4e80f19a4efffe9877bb7fdba50c Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Wed, 17 Jul 2019 15:40:54 -0400 Subject: [PATCH] letters doesn't exist in python 3.6 Use `ascii_letters` instead which is a reasonable alternative for our usecases. --- lms/envs/test.py | 4 ++-- openedx/core/djangoapps/user_api/accounts/utils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lms/envs/test.py b/lms/envs/test.py index 07cae4198d..227c50bb83 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -18,7 +18,7 @@ import logging import os from collections import OrderedDict from random import choice -from string import digits, letters, punctuation +from string import digits, ascii_letters, punctuation from uuid import uuid4 import openid.oidutil @@ -292,7 +292,7 @@ FEATURES['ENABLE_PAYMENT_FAKE'] = True # the same settings, we can generate this randomly and guarantee # that they are using the same secret. RANDOM_SHARED_SECRET = ''.join( - choice(letters + digits + punctuation) + choice(ascii_letters + digits + punctuation) for x in range(250) ) diff --git a/openedx/core/djangoapps/user_api/accounts/utils.py b/openedx/core/djangoapps/user_api/accounts/utils.py index 314896f840..1d8b59b7bc 100644 --- a/openedx/core/djangoapps/user_api/accounts/utils.py +++ b/openedx/core/djangoapps/user_api/accounts/utils.py @@ -180,7 +180,7 @@ def retrieve_last_sitewide_block_completed(user): ) -def generate_password(length=12, chars=string.letters + string.digits): +def generate_password(length=12, chars=string.ascii_letters + string.digits): """Generate a valid random password""" if length < 8: raise ValueError("password must be at least 8 characters")