Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#22686 closed Bug (fixed)

makemessages crashes with unicode filename and verbose > 1

Reported by: Arthur Koziel Owned by: nobody
Component: Internationalization Version: 1.6
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Running makemessages with a verbose level of >1 crashes with a UnicodeDecodeError when using a filename with unicode chars in it.

Steps to reproduce:

  1. Create file with unicode chars in it (e.g. "200x200-åäöåäöåäöåäö.png")
  2. Run "makemessages -v2"

Result: "UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 8: ordinal not in range(128)"
Expected: Command should skip file and print "UnicodeDecodeError: skipped file %s in %s" to stdout

Change History (4)

comment:1 by Claude Paroz, 10 years ago

Component: UncategorizedInternationalization
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

I can reproduce. Passing unicode to os.walk should solve the issue. However, I'm not very comfortable adding non-ascii file names in the Django tree to test that issue.

comment:2 by Claude Paroz <claude@…>, 10 years ago

Resolution: fixed
Status: newclosed

In dbb48d2bb99a5f660cf2d85f137b8d87fc12d99f:

Applied unicode_literals to makemessages command

This also fixes #22686 as some sort of side-effect.

comment:3 by Claude Paroz <claude@…>, 10 years ago

In cdfefbec721b59695e28e5992eda1cc52af48212:

[1.7.x] Applied unicode_literals to makemessages command

This also fixes #22686 as some sort of side-effect.
Backport of dbb48d2bb99 from master.

comment:4 by Claude Paroz <claude@…>, 10 years ago

In 67870137b9e1f1384af7465b4eb978d0f4dab3b7:

[1.7.x] Fixed #22686 -- Prevented makemessages crash with unicode filename

A more extensive fix has been reverted on the 1.7.x branch, so this
minimal fix replaces it.

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