mirror of
				https://github.com/django/django.git
				synced 2025-10-29 00:26:07 +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:
		| @@ -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: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user