Skip to content

Commit

Permalink
refactor: convert string with anomalous backslash into a raw string
Browse files Browse the repository at this point in the history
Backslash is present in the literal string but is not a valid escape sequence. If it is intended to be an escape sequence, use the correct escape characters. If it is intended to be a literal backslash, it can either be replaced with with an escaped backslash `\\`, or you can add an `r` prefix to make it a "raw" string.
  • Loading branch information
deepsource-autofix[bot] committed Dec 24, 2023
1 parent ba623cb commit 8523c36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gui/download2.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def get_lecturers(course_list, user_id, access_token):
global course_id, class_id, subject_id, tutor_id, lecturer_id, course_name
course_id = course_list['courseid']
tutor_id = course_list['tutorid']
tr_table = str.maketrans('\/:*?"<>|', '\/:*?"<>|')
tr_table = str.maketrans(r'\/:*?"<>|', '\/:*?"<>|')
course_name = course_list['name'].translate(tr_table)
additional_data = f'?stuId={user_id}&stdCourseId={course_id}&type=1&needPage=1&page=1&perPage=500&order=asc'
url += additional_data
Expand Down

0 comments on commit 8523c36

Please sign in to comment.