#22107 closed Bug (fixed)
Iterating over File broken in Python 3
Reported by: | Peter De Wachter | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | 1.6 |
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
django.core.files.File has an iterator to allow line-by-line access to the file. This does not work in Python 3 due to string/bytestring confusion. Attached patch fixes this and adds a regression test.
Attachments (1)
Change History (5)
by , 11 years ago
Attachment: | file-iteration.diff added |
---|
comment:1 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
follow-up: 4 comment:2 by , 11 years ago
Triage Stage: | Unreviewed → Accepted |
---|
I think this would be a good candidate for backporting...
comment:4 by , 11 years ago
Replying to claudep:
I think this would be a good candidate for backporting...
The problem has probably been here since 1.5 but I only backported to 1.6 because it's the first release that has full Python 3 support (1.5 had "experimental" support if I remember correctly).
In 3841feee86cae65165f120db7a5d80ffc76dd520: