Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#9344 closed (fixed)

TemporaryFile is missing the 'tell' method on Windows platforms

Reported by: julien Owned by: mitsuhiko
Component: File uploads/storage Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The tell() method is missing in the specific implementation of TemporaryFile for Windows platforms, which causes crashes when using PIL, for example. Simple fix attached.

Attachments (3)

9344.temporaryfile-tell.diff (572 bytes) - added by julien 6 years ago.
9344.temporaryfile-tell.2.diff (571 bytes) - added by julien 6 years ago.
9344-temporary-file-delegation.patch (817 bytes) - added by mitsuhiko 6 years ago.
delegates attribute lookups to the underlaying file.

Download all attachments as: .zip

Change History (10)

Changed 6 years ago by julien

Changed 6 years ago by julien

comment:1 Changed 6 years ago by julien

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

FYI, #7769 was checked in right before 1.0 was released. That patch didn't contain tests so I thought this ticket would also be considered "trivial" enough. Should tests be written for this ticket? It would seem like overkill to me.

comment:2 Changed 6 years ago by jacob

  • milestone set to 1.1
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 6 years ago by mitsuhiko

  • Owner changed from nobody to mitsuhiko

Changed 6 years ago by mitsuhiko

delegates attribute lookups to the underlaying file.

comment:4 Changed 6 years ago by mitsuhiko

The patch above changes the class to forward the attribute lookups to the underlying file object so all calls should be supported now. This is actually how a lot of the file wrappers in python are implemented, so I suppose it should be fine.

comment:5 Changed 6 years ago by jacob

  • Triage Stage changed from Accepted to Ready for checkin

comment:6 Changed 6 years ago by gwilson

  • Resolution set to fixed
  • Status changed from new to closed

(In [10700]) [1.0.X]: Fixed #9344 -- In the TemporaryFile class used by Windows, proxy to the wrapped file object. Thanks julien and mitsuhiko.

Backport of r10699 from trunk.

comment:7 Changed 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

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