#23888 closed Bug (fixed)
UnicodeEncodeError on repr of File with unicode name
Reported by: | Sergey Fedoseev | Owned by: | Sergey Fedoseev |
---|---|---|---|
Component: | File uploads/storage | Version: | dev |
Severity: | Normal | 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
Related to #8156.
In [1]: from django.core.files import File In [2]: File(None, u'djángö') Out[2]: <repr(<django.core.files.base.File at 0x7ff771a2ce90>) failed: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe1' in position 9: ordinal not in range(128)>
Change History (6)
comment:1 by , 10 years ago
Triage Stage: | Unreviewed → Accepted |
---|
follow-up: 3 comment:2 by , 10 years ago
This commit seems to fix the problem: https://github.com/berkerpeksag/django/compare/23888 I'll add a release note and open a pull request.
comment:3 by , 10 years ago
Replying to berkerpeksag:
This commit seems to fix the problem: https://github.com/berkerpeksag/django/compare/23888 I'll add a release note and open a pull request.
Sorry, but I was first! =)
Already made a PR.
comment:4 by , 10 years ago
Has patch: | set |
---|
PR at https://github.com/django/django/pull/3594 (make sure you include links to pull requests in tickets because some of us don't check both).
comment:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Hi,
Indeed, the
repr
appears to be broken.Not sure what the best way to solve it is. Maybe using
name.encode('raw_unicode_escape')
on python 2?Thanks.