[Django] #26646: Add IOBase methods required by TextIOWrapper to FileProxyMixin.

21 views
Skip to first unread message

Django

unread,
May 22, 2016, 12:31:31 PM5/22/16
to django-...@googlegroups.com
#26646: Add IOBase methods required by TextIOWrapper to FileProxyMixin.
-------------------------------------+-------------------------------------
Reporter: charettes | Owner: charettes
Type: New | Status: new
feature |
Component: File | Version: master
uploads/storage |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
It should be possible to use `File` objects returned by `FileField` in a
`io.TextIOWrapper`.

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.

Django

unread,
May 22, 2016, 12:46:24 PM5/22/16
to django-...@googlegroups.com
#26646: Add IOBase methods required by TextIOWrapper to FileProxyMixin.
-------------------------------------+-------------------------------------
Reporter: charettes | Owner: charettes
Type: New feature | Status: new

Component: File | Version: master
uploads/storage |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by charettes):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/6639 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/26646#comment:1>

Django

unread,
May 23, 2016, 9:10:24 AM5/23/16
to django-...@googlegroups.com
#26646: Add IOBase methods required by TextIOWrapper to FileProxyMixin.
-------------------------------------+-------------------------------------
Reporter: charettes | Owner: charettes
Type: New feature | Status: new

Component: File | Version: master
uploads/storage |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/26646#comment:2>

Django

unread,
May 27, 2016, 6:21:01 PM5/27/16
to django-...@googlegroups.com
#26646: Add IOBase methods required by TextIOWrapper to FileProxyMixin.
-------------------------------------+-------------------------------------
Reporter: charettes | Owner: charettes
Type: New feature | Status: new

Component: File | Version: master
uploads/storage |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/26646#comment:3>

Django

unread,
May 27, 2016, 9:12:42 PM5/27/16
to django-...@googlegroups.com
#26646: Add IOBase methods required by TextIOWrapper to FileProxyMixin.
-------------------------------------+-------------------------------------
Reporter: charettes | Owner: charettes
Type: New feature | Status: closed

Component: File | Version: master
uploads/storage |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette <charette.s@…>):

* 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>

Reply all
Reply to author
Forward
0 new messages