#4776 closed (fixed)
Unicode branch merge and strftime in FileField upload_to
Reported by: | Owned by: | Malcolm Tredinnick | |
---|---|---|---|
Component: | Uncategorized | Version: | dev |
Severity: | Keywords: | unicode strftime | |
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 experience file upload breakage after merger of the unicode branch.
The strftime function on line 738 in django/db/models/fields/init.py gave the following error:
TypeError: strftime() argument 1 must be str, not unicode
I have included a simple patch to byte-stringify the input to the strftime method... that may not be the best strategy to take.
Mike.
Attachments (1)
Change History (5)
by , 17 years ago
Attachment: | strftime_unicode.diff added |
---|
comment:1 by , 17 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 17 years ago
Owner: | changed from | to
---|
The patch is the right idea, although since it has very draconian error handling (Django will crash if self.upload_to is not ASCII), we need to verify that the value going in there really can only be ASCII.
comment:3 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I'll let the unicode ninjas decide how best to handle this...