[Django] #34407: Report faulty file when some static file has non-utf-8 encoding

9 views
Skip to first unread message

Django

unread,
Mar 11, 2023, 11:30:51 AM3/11/23
to django-...@googlegroups.com
#34407: Report faulty file when some static file has non-utf-8 encoding
------------------------------------------------+------------------------
Reporter: Claude Paroz | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.staticfiles | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/34407>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 11, 2023, 1:22:04 PM3/11/23
to django-...@googlegroups.com
#34407: Report faulty file when some static file has non-utf-8 encoding
--------------------------------------+------------------------------------

Reporter: Claude Paroz | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* stage: Unreviewed => Accepted


Comment:

Agreed, we could improve an error message.

--
Ticket URL: <https://code.djangoproject.com/ticket/34407#comment:1>

Django

unread,
Mar 12, 2023, 7:26:16 AM3/12/23
to django-...@googlegroups.com
#34407: Report faulty file when some static file has non-utf-8 encoding
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Claude
Type: | Paroz
Cleanup/optimization | Status: assigned

Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* owner: nobody => Claude Paroz
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/34407#comment:2>

Django

unread,
Mar 12, 2023, 7:30:30 AM3/12/23
to django-...@googlegroups.com
#34407: Report faulty file when some static file has non-utf-8 encoding
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Claude
Type: | Paroz
Cleanup/optimization | Status: assigned
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/16646 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/34407#comment:3>

Django

unread,
Mar 12, 2023, 10:18:16 AM3/12/23
to django-...@googlegroups.com
#34407: Report faulty file when some static file has non-utf-8 encoding
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Claude
Type: | Paroz
Cleanup/optimization | Status: assigned
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/34407#comment:4>

Django

unread,
Mar 12, 2023, 11:55:30 AM3/12/23
to django-...@googlegroups.com
#34407: Report faulty file when some static file has non-utf-8 encoding
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Claude
Type: | Paroz
Cleanup/optimization | Status: closed
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"03bc92af978f2148c1141673c730f17772cd7037" 03bc92af]:
{{{
#!CommitTicketReference repository=""
revision="03bc92af978f2148c1141673c730f17772cd7037"
Fixed #34407 -- Reported filename when decoding fails in collectstatic's
post_process.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34407#comment:5>

Reply all
Reply to author
Forward
0 new messages