diff --git a/common/lib/xmodule/xmodule/course_metadata_utils.py b/common/lib/xmodule/xmodule/course_metadata_utils.py index faa43f37b3..c862356513 100644 --- a/common/lib/xmodule/xmodule/course_metadata_utils.py +++ b/common/lib/xmodule/xmodule/course_metadata_utils.py @@ -66,8 +66,9 @@ def clean_course_key(course_key, padding_char): padding_char (str): Character used for padding at end of the encoded string. The standard value for this is '='. """ + encoded = b32encode(six.text_type(course_key).encode('utf8')).decode('utf8') return "course_{}".format( - b32encode(six.text_type(course_key)).replace('=', padding_char) + encoded.replace('=', padding_char) )