mirror of
https://github.com/django/django.git
synced 2024-12-22 17:16:24 +00:00
Forced utf-8 encoding when loading common passwords in CommonPasswordValidator.
Previously we used `decode()` which defaults to utf-8. This change
restores previous behavior.
Follow up to 28eac41510
.
This commit is contained in:
parent
a2c31e12da
commit
2007e11d70
@ -171,7 +171,7 @@ class CommonPasswordValidator:
|
||||
|
||||
def __init__(self, password_list_path=DEFAULT_PASSWORD_LIST_PATH):
|
||||
try:
|
||||
with gzip.open(password_list_path, 'rt') as f:
|
||||
with gzip.open(password_list_path, 'rt', encoding='utf-8') as f:
|
||||
self.passwords = {x.strip() for x in f}
|
||||
except OSError:
|
||||
with open(password_list_path) as f:
|
||||
|
Loading…
Reference in New Issue
Block a user