1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #34407 -- Reported filename when decoding fails in collectstatic's post_process.

This commit is contained in:
Claude Paroz
2023-03-12 12:28:00 +01:00
committed by Mariusz Felisiak
parent 4db33e96d1
commit 03bc92af97
3 changed files with 18 additions and 1 deletions

View File

@@ -353,7 +353,10 @@ class HashedFilesMixin:
# ..to apply each replacement pattern to the content
if name in adjustable_paths:
old_hashed_name = hashed_name
content = original_file.read().decode("utf-8")
try:
content = original_file.read().decode("utf-8")
except UnicodeDecodeError as exc:
yield name, None, exc, False
for extension, patterns in self._patterns.items():
if matches_patterns(path, (extension,)):
for pattern, template in patterns: