#34407 closed Cleanup/optimization (fixed)

Report faulty file when some static file has non-utf-8 encoding

Reported by: Claude Paroz Owned by: Claude Paroz
Component: contrib.staticfiles Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When running collectstatic and one of the file is not encoded in UTF-8, the post_process method raises:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 41998: invalid start byte without any clue about the wrong file. It would be nice to report which file produced the error.

Change History (5)

comment:1 by Mariusz Felisiak, 21 months ago

Triage Stage: UnreviewedAccepted

Agreed, we could improve an error message.

comment:2 by Claude Paroz, 21 months ago

Owner: changed from nobody to Claude Paroz
Status: newassigned

comment:3 by Claude Paroz, 21 months ago

Has patch: set

comment:4 by Mariusz Felisiak, 21 months ago

Triage Stage: AcceptedReady for checkin

comment:5 by Mariusz Felisiak <felisiak.mariusz@…>, 21 months ago

Resolution: fixed
Status: assignedclosed

In 03bc92af:

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

Note: See TracTickets for help on using tickets.
Back to Top