Code

Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#7769 closed (fixed)

[patch] TemporaryUploadedFile is missing a few methods/params

Reported by: Mads Sülau Jørgensen <django@…> Owned by: nobody
Component: HTTP handling Version: master
Severity: Keywords: #2070-fixes
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

seek on TemporaryUploadedFile is missing the whence parameter.

TemporaryUploadedFile and InMemoryUploadedFile are missing tell() methods, which has been added for convenience.

Also renames file on InMemoryUploadedFile for consistency with TemporaryUploadedFile.

Attachments (2)

uploaded_file.diff (2.0 KB) - added by Mads Sülau Jørgensen <django@…> 6 years ago.
uploaded_file.2.diff (2.0 KB) - added by Mads Sülau Jørgensen <django@…> 6 years ago.
Removed write from InMemoryTemporaryFile

Download all attachments as: .zip

Change History (9)

Changed 6 years ago by Mads Sülau Jørgensen <django@…>

Changed 6 years ago by Mads Sülau Jørgensen <django@…>

Removed write from InMemoryTemporaryFile

comment:1 Changed 6 years ago by jacob

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 6 years ago by jacob

  • Summary changed from [patch] Missing seek() whence parameter in TemporaryUploadedFile + add tell() to [patch] TemporaryUploadedFile is missing a few methods/params

comment:3 Changed 6 years ago by vomjom

This patch fixes an issue I had, but I'd like to mention that it still has a bug:

SimpleUploadedFile is a subclass of InMemoryUploadedFile, so it uses its tell() and seek() functions, which expect a _file member, but SimpleUploadedFile calls it file, so those functions don't work for a SimpleUploadedFile.

comment:4 Changed 6 years ago by julien

  • milestone set to 1.0

#7900 was closed at a dupe, as it only looked at the missing tell method and therefore was a subset of this ticket. Also setting this one as milestone 1.0.

comment:5 Changed 6 years ago by julien

One question though. Since this ticket is adding new features, can it actually be considered for 1.0? #7900 was set to 1.0, that's why I just set this one as well, but a core dev might think otherwise.

comment:6 Changed 6 years ago by jacob

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

(In [8634]) Fixed #7769: Added a couple missing file methods to TemporaryUploadedFile. Thanks, Mads Sülau Jørgensen.

comment:7 Changed 3 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.