Opened 8 years ago
Closed 8 years ago
#26646 closed New feature (fixed)
Add IOBase methods required by TextIOWrapper to FileProxyMixin.
Reported by: | Simon Charette | Owned by: | Simon Charette |
---|---|---|---|
Component: | File uploads/storage | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
It should be possible to use File
objects returned by FileField
in a io.TextIOWrapper
.
e.g.
import csv from io import TextIOWrapper with TextIOWrapper(model_instance.csv_file, 'utf-8') as wrapper: reader = csv.reader(wrapper) ...
This requires adding the missing readable()
, writable()
methods and making the seekable()
method of FileProxyMixin()
available even on Python 2 (#24963 added it for Python 3 only).
Change History (4)
comment:1 by , 8 years ago
Has patch: | set |
---|
comment:2 by , 8 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 8 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Note:
See TracTickets
for help on using tickets.
PR