Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#9404 closed (fixed)

Proxy file-like methods and attributes in UploadedFile objects

Reported by: magneto Owned by: Armin Ronacher
Component: File uploads/storage Version: dev
Severity: 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

Simply to make the InMemoryUploadedFile file proxy functions match the same bits as TemporaryUploadedFile .. so they can be used interchangeably

Attachments (2)

uploadedfile_stringio_proxies.diff (694 bytes ) - added by magneto 16 years ago.
readlines, xreadlines, and iter
flesh_out_uploaded_file.diff (4.4 KB ) - added by Todd O'Bryan 16 years ago.

Download all attachments as: .zip

Change History (10)

by magneto, 16 years ago

readlines, xreadlines, and iter

by Todd O'Bryan, 16 years ago

comment:1 by Todd O'Bryan, 16 years ago

Summary: Proxy more File methods in InMemoryUploadedFileProxy file-like methods and attributes in UploadedFile objects

I went through and proxied every method and attribute listed for file-like objects here:

http://docs.python.org/library/stdtypes.html#file-objects

Of note is that if you try to use a method or attribute that is not implemented for the backing class, you'll get exactly the same error you would get if you tried to call that method or access that attribute on the backing class directly. (For example, if you try to call fileno() on a StringIO object, you'll get exactly the same error as you'd get calling fileno() on an InMemoryUploadedFile because it's backed by a StringIO object.) If any of these methods or attributes are later implemented on the backing objects, they should work.

comment:2 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

comment:3 by Jacob, 16 years ago

milestone: 1.1
Triage Stage: UnreviewedAccepted

comment:4 by Armin Ronacher, 16 years ago

I guess it would make sense to apply the fleshed out version of the patch and refactor the file system for 1.2. There are some really weird things going on.

comment:5 by Armin Ronacher, 16 years ago

Actually. the smaller patch is sufficient for 1.1.

comment:6 by Armin Ronacher, 16 years ago

Owner: changed from nobody to Armin Ronacher

This is fixed in the branch of Alex and me already.

comment:7 by Jacob, 16 years ago

Resolution: fixed
Status: newclosed

Fixed in [10717].

comment:8 by Jacob, 13 years ago

milestone: 1.1

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top