#20354 closed Bug (fixed)
`makemessages` crashes when reading non-UTF8 encoded files.
Reported by: | Tai Lee | Owned by: | nobody |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have a project with a 3rd party bundled file (MIT-license.txt
) which is apparently not encoded with UTF-8 and contains some characters that makes the makemessages
management command crash with a UnicodeDecodeError
. It outputs the full contents of the file, but not the file name or location. Not very helpful.
I don't really want to have to search my project for 3rd party non-UTF8 files with a .txt
or .html
extension and convert them to UTF8. I'd rather leave 3rd party files as they are so I can diff and update them easier.
I also don't really want to do a find across the whole project looking for a match against the content that caused the error, so I can work out the filename and explicitly ignore it with a glob pattern.
I'd like Django to simply warn me that the file generated a UnicodeDecodeError
and was skipped, then continue processing other files. If it's important, then I can go and fix it.
Change History (4)
comment:1 by , 12 years ago
Has patch: | set |
---|
comment:2 by , 12 years ago
Severity: | Normal → Release blocker |
---|---|
Triage Stage: | Unreviewed → Accepted |
It might be a regression in 1.5.
comment:3 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
PR with fix and tests. https://github.com/django/django/pull/1045