diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-05-23 08:39:16 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-23 08:39:16 +0200 |
| commit | 2007e11d7069b0f6ed673c7520ee7f480f07de68 (patch) | |
| tree | 701f4737b2a5ebb2785dfc438a62353e334177a7 /django/contrib/auth/password_validation.py | |
| parent | a2c31e12da272acc76f3a3a0157fae9a7f6477ac (diff) | |
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 28eac41510eb9de728bdfbc22a36f33ac75394f2.
Diffstat (limited to 'django/contrib/auth/password_validation.py')
| -rw-r--r-- | django/contrib/auth/password_validation.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/contrib/auth/password_validation.py b/django/contrib/auth/password_validation.py index bfdc096a9a..59fd726f9f 100644 --- a/django/contrib/auth/password_validation.py +++ b/django/contrib/auth/password_validation.py @@ -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: |
