e.g.
{{{#!python
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).
--
Ticket URL: <https://code.djangoproject.com/ticket/26646>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/6639 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/26646#comment:1>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/26646#comment:2>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/26646#comment:3>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"4f474607de9b470f977a734bdd47590ab202e778" 4f474607]:
{{{
#!CommitTicketReference repository=""
revision="4f474607de9b470f977a734bdd47590ab202e778"
Fixed #26646 -- Added IOBase methods required by TextIOWrapper to File.
Thanks Tim for the review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26646#comment:4>