Re: [Django] #11857: TemporaryFile class is missing the closed - attribute

73 views
Skip to first unread message

Django

unread,
Jul 25, 2011, 7:37:23 AM7/25/11
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
------------------------------------+--------------------------------------
Reporter: andi100 | Owner: petar
Type: Bug | Status: assigned
Milestone: | Component: File uploads/storage
Version: | Severity: Normal
Resolution: | Keywords: TemporaryFile closed
Triage Stage: Accepted | Has patch: 1
Needs documentation: 0 | Needs tests: 1
Patch needs improvement: 1 | Easy pickings: 0
UI/UX: 0 |
------------------------------------+--------------------------------------
Changes (by homeip127@…):

* ui_ux: => 0
* version: SVN =>
* easy: => 0


Comment:

Bug still present! Django 1.3


{{{
File "C:\Python26\lib\site-packages\django\forms\forms.py" in full_clean
269. self._post_clean()
File "C:\Python26\lib\site-packages\django\forms\models.py" in _post_clean
308. self.instance = construct_instance(self, self.instance,
opts.fields, opts.exclude)
File "C:\Python26\lib\site-packages\django\forms\models.py" in
construct_instance
53. f.save_form_data(instance, cleaned_data[f.name])
File "C:\Python26\lib\site-packages\django\db\models\fields\files.py" in
save_form_data
281. setattr(instance, self.name, data)
File "C:\Python26\lib\site-packages\django\db\models\fields\files.py" in
__set__
314. self.field.update_dimension_fields(instance,
force=True)
File "C:\Python26\lib\site-packages\django\db\models\fields\files.py" in
update_dimension_fields
382. width = file.width
File "C:\Python26\lib\site-packages\django\core\files\images.py" in
_get_width
15. return self._get_image_dimensions()[0]
File "C:\Python26\lib\site-packages\django\core\files\images.py" in
_get_image_dimensions
24. close = self.closed
File "C:\Python26\lib\site-packages\django\db\models\fields\files.py" in
_get_closed
127. return file is None or file.closed
File "C:\Python26\lib\site-packages\django\core\files\base.py" in
_get_closed
51. return not self.file or self.file.closed

Exception Type: AttributeError at /photo/upload/
Exception Value: 'TemporaryFile' object has no attribute 'closed'
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 25, 2011, 7:47:47 AM7/25/11
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
------------------------------------+--------------------------------------
Reporter: andi100 | Owner: petar
Type: Bug | Status: assigned
Milestone: | Component: File uploads/storage
Version: | Severity: Normal
Resolution: | Keywords: TemporaryFile closed
Triage Stage: Accepted | Has patch: 1
Needs documentation: 0 | Needs tests: 1
Patch needs improvement: 1 | Easy pickings: 0
UI/UX: 0 |
------------------------------------+--------------------------------------

Comment (by kmtracey):

Note it's is not necessary or or particularly helpful to post that still-
open bugs are still recreatable. This bug is open, there is no indication
anywhere in it that I can see that it has been fixed, so it's expected
that it's still present. If you find an open bug that can no longer be
recreated, that would be something to post (and possibly close the
ticket), but posting that open bugs are still there is just noise.

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:7>

Django

unread,
Aug 22, 2011, 3:26:17 PM8/22/11
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
------------------------------------+--------------------------------------
Reporter: andi100 | Owner: petar
Type: Bug | Status: assigned
Milestone: | Component: File uploads/storage
Version: | Severity: Normal
Resolution: | Keywords: TemporaryFile closed
Triage Stage: Accepted | Has patch: 1
Needs documentation: 0 | Needs tests: 1
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
------------------------------------+--------------------------------------
Changes (by rush340):

* needs_better_patch: 1 => 0
* easy: 0 => 1


Comment:

Replying to [comment:4 danostrowski]:
> This issue is still present, as I've had the same problem.
>
> However, the patch attached will not work if inserted as presented.
'temp.py' has had a lot of it's contents moved into 'tempfile.py' and
there's apparently different classes now for temporary files based on
whether you're using 'nt' or not. I am developing on Windows so this is of
concern to me.

The patch works fine for me, and I don't see why it wouldn't for you.
What issues are you having with it? Also, tempfile is not part of Django,
it is imported from the Python Standard Library.

temp.py just tells Django what class to use for temporary files. If you
are using a Windows NT OS, temp.py will define a custom TemporaryFile
class for Django to use. If you are not using a Windows NT OS, temp.py
will tell Django to just use the tempfile.NamedTemporaryFile class. The
reason for this is that NamedTemporaryFile cannot be reopened with a
Windows NT OS.

This bug is caused because the custom TemporaryFile object Django defines
for NT does not have a closed property, but self.closed is accessed when
using the inherited open method. If you are not using NT, this bug won't
affect you.

The patch seems to add the property with the expected behavior. In
addition to the changes made by the patch, it seems like it would be
cleaner to only use the custom TemporaryFile object regardless of OS.
It's a pretty simple class and I don't see any platform specific notes for
the Standard Library functionality used by it.

Either way, just applying the patch should work. It just needs a test.

I'll try to get to it if I have time, but I'm pretty busy at the moment.

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:8>

Django

unread,
Oct 11, 2011, 10:28:32 AM10/11/11
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
--------------------------------------+------------------------------------
Reporter: andi100 | Owner: petar
Type: Bug | Status: assigned
Component: File uploads/storage | Version:
Severity: Normal | Resolution:
Keywords: TemporaryFile closed | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by anonymous):

The patch works fine for me.

Environment - Windows 2008 server, Apache + mod_wsgi, Django 1.3

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:9>

Django

unread,
Nov 6, 2011, 3:23:02 PM11/6/11
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
--------------------------------------+------------------------------------
Reporter: andi100 | Owner: petar
Type: Bug | Status: assigned
Component: File uploads/storage | Version:
Severity: Normal | Resolution:
Keywords: TemporaryFile closed | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by anentropic):

Patch worked for me: Windows 7 64 bit, Django 1.3 dev server

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:10>

Django

unread,
Feb 18, 2012, 12:35:06 PM2/18/12
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner: petar
Type: Bug | Status: assigned
Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 1 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by claudep):

* keywords: TemporaryFile closed => TemporaryFile closed windows


--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:11>

Django

unread,
Mar 1, 2012, 2:19:52 PM3/1/12
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner: petar
Type: Bug | Status: assigned
Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 1 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------

Comment (by anonymous):

Patch doesn't work on Win 8

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:12>

Django

unread,
Mar 1, 2012, 2:24:53 PM3/1/12
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner: petar
Type: Bug | Status: assigned
Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 1 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------

Comment (by anonymous):

Sorry it does work on win8 django 1.3.1 devserver

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:13>

Django

unread,
Mar 9, 2013, 9:42:38 AM3/9/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner:
Type: Bug | Status: new

Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 1 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by AnkitBagaria):

* owner: petar =>
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:14>

Django

unread,
Mar 29, 2013, 11:05:58 PM3/29/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner: susan
Type: Bug | Status: assigned

Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 1 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by susan):

* owner: => susan
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:15>

Django

unread,
Apr 4, 2013, 8:23:28 PM4/4/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner: susan
Type: Bug | Status: assigned
Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 1 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by jdunck):

* cc: jdunck@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:16>

Django

unread,
Apr 25, 2013, 6:27:41 AM4/25/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner: susan
Type: Bug | Status: assigned
Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 1 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------

Comment (by pombredanne):

I experienced the same issue on win7 and django 1.5.1.
Susan, do you want a patch?

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:17>

Django

unread,
Apr 25, 2013, 11:46:28 AM4/25/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner: susan
Type: Bug | Status: assigned
Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 1 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by pombredanne@…):

* cc: pombredanne@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:18>

Django

unread,
Apr 25, 2013, 3:44:35 PM4/25/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner: susan
Type: Bug | Status: assigned
Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 1 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------

Comment (by susan):

Sure, I'll appreciate. Since Im running macOS, and the bug appears only on
windowsOS, I think I may have difficulty replicating this bug.

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:19>

Django

unread,
Apr 27, 2013, 4:40:59 AM4/27/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner: susan
Type: Bug | Status: assigned
Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 1 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------

Comment (by pombredanne@…):

susan, let me craft that and reference a pull request here.

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:20>

Django

unread,
Apr 27, 2013, 5:02:48 AM4/27/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner:
Type: Bug | pombredanne
Component: File | Status: assigned

uploads/storage | Version:
Severity: Normal | Resolution:
Keywords: TemporaryFile | Triage Stage: Accepted
closed windows | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 0
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by pombredanne):

* owner: susan => pombredanne


--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:21>

Django

unread,
Apr 30, 2013, 6:47:10 AM4/30/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner:
Type: Bug | pombredanne
Component: File | Status: assigned
uploads/storage | Version:
Severity: Normal | Resolution:
Keywords: TemporaryFile | Triage Stage: Accepted
closed windows | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 1 | UI/UX: 0
Easy pickings: 1 |
-------------------------------------+-------------------------------------

Comment (by pombredanne):

Since Python 2.6, `tempfile.NamedTemporaryFile` has a new attribute:
`delete=True/False` which likely removes the needs entirely to have a
`django.core.temp.NamedTemporaryFile` wrapper specifically for 'nt'. I
will investigate this since 2.6 is a requirement for 1.5.x. The lack of a
closed attribute is something that happens only in some contexts and is
something that is injected elsewhere and I am still trying to understand
where/when exactly.

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:22>

Django

unread,
Jun 16, 2013, 11:48:25 AM6/16/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner:
Type: Bug | Status: new

Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 1 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by pombredanne):

* owner: pombredanne =>


* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:23>

Django

unread,
Jun 16, 2013, 11:49:10 AM6/16/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner:
Type: Bug | Status: new
Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 1 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------

Comment (by pombredanne):

I am unassigning this ticket from me, as I am not able to work on it in
the short term ... but this is still on my radar

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:24>

Django

unread,
Sep 6, 2013, 10:31:49 AM9/6/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner: anonymous
Type: Bug | Status: assigned

Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 1 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by adamsc64):

* owner: => anonymous


* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:25>

Django

unread,
Sep 6, 2013, 2:38:15 PM9/6/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner: anonymous
Type: Bug | Status: assigned
Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by anonymous):

* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:26>

Django

unread,
Sep 6, 2013, 2:42:50 PM9/6/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner: anonymous
Type: Bug | Status: assigned
Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------

Comment (by adamsc64):

Submitted a pull request that should solve this at
https://github.com/django/django/pull/1566. This could probably easily be
made into a bug fix for previous versions of Django, as it's just a few
lines of code and the issue seems to be very old.

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:27>

Django

unread,
Sep 6, 2013, 2:47:11 PM9/6/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner: anonymous
Type: Bug | Status: assigned
Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------

Comment (by Christopher Adams <christopher.r.adams@…>):

- TemporaryFile now minimally mocks the API of the Python standard library
class tempfile.NamedTemporaryFile to avoid AttributeError exceptions.
- The symbol django.core.files.NamedTemporaryFile is actually assigned as
a different class on different operating systems.
- The bug only occurred if Django is running on Windows, hence why it was
hard to diagnose.
- All tests pass with ./runtests.py --settings=test_sqlite

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:28>

Django

unread,
Sep 6, 2013, 2:56:39 PM9/6/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner:
Type: Bug | Status: new

Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by Christopher Adams <christopher.r.adams@…>):

* status: assigned => new

* owner: anonymous =>


--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:29>

Django

unread,
Sep 6, 2013, 2:59:23 PM9/6/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner:
Type: Bug | Status: closed
Component: File | Version:
uploads/storage | Resolution: fixed
Severity: Normal | Triage Stage:
Keywords: TemporaryFile | Unreviewed

closed windows | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0

Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by Christopher Adams <christopher.r.adams@…>):

* status: new => closed
* resolution: => fixed
* stage: Accepted => Unreviewed


--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:30>

Django

unread,
Sep 6, 2013, 3:33:48 PM9/6/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner:
Type: Bug | Status: new

Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by timo):

* status: closed => new
* resolution: fixed =>
* stage: Unreviewed => Accepted


Comment:

Please don't close a ticket until the fix has been committed to master.

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:31>

Django

unread,
Sep 6, 2013, 4:38:45 PM9/6/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner:
Type: Bug | Status: new
Component: File | Version:
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: TemporaryFile | Needs documentation: 0
closed windows | Patch needs improvement: 0
Has patch: 1 | UI/UX: 0
Needs tests: 0 |
Easy pickings: 1 |
-------------------------------------+-------------------------------------
Changes (by Christopher Adams <christopher.r.adams@…>):

* cc: christopher.r.adams@… (added)


Comment:

Gotcha. Sorry about that - I'm a n00b!

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:32>

Django

unread,
Sep 6, 2013, 8:38:44 PM9/6/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner:
Type: Bug | Christopher Adams
Component: File | <christopher.r.adams@…>
uploads/storage | Status: closed
Severity: Normal | Version:
Keywords: TemporaryFile | Resolution: fixed
closed windows | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Christopher Adams <christopher.r.adams@…>):

* status: new => closed
* owner: => Christopher Adams <christopher.r.adams@…>
* resolution: => fixed


Comment:

In [changeset:"b2f5ac16565605f20a0c4e90acc6beed5a5ac1ce"]:
{{{
#!CommitTicketReference repository=""
revision="b2f5ac16565605f20a0c4e90acc6beed5a5ac1ce"
Fixed #11857 -- Added missing 'closed' property on TemporaryFile class.

- TemporaryFile now minimally mocks the API of the Python standard
library class tempfile.NamedTemporaryFile to avoid AttributeError
exceptions.
- The symbol django.core.files.NamedTemporaryFile is actually assigned
as a different class on different operating systems.
- The bug only occurred if Django is running on Windows, hence why it
was hard to diagnose.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:33>

Django

unread,
Sep 6, 2013, 8:38:44 PM9/6/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner:
Type: Bug | Christopher Adams
Component: File | <christopher.r.adams@…>
uploads/storage | Status: closed
Severity: Normal | Version:
Keywords: TemporaryFile | Resolution: fixed
closed windows | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Russell Keith-Magee <russell@…>):

In [changeset:"926bc421d9bcf04a79f0026a60d3d4b0570b7fe2"]:
{{{
#!CommitTicketReference repository=""
revision="926bc421d9bcf04a79f0026a60d3d4b0570b7fe2"
Merge pull request #1566 from adamsc64/ticket_11857

Fixed #11857 -- Added missing 'closed' property on TemporaryFile class.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:34>

Django

unread,
Sep 6, 2013, 8:45:12 PM9/6/13
to django-...@googlegroups.com
#11857: TemporaryFile class is missing the closed - attribute
-------------------------------------+-------------------------------------
Reporter: andi100 | Owner:
Type: Bug | Christopher Adams
Component: File | <christopher.r.adams@…>
uploads/storage | Status: closed
Severity: Normal | Version:
Keywords: TemporaryFile | Resolution: fixed
closed windows | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Russell Keith-Magee <russell@…>):

In [changeset:"2a2ac5c1400c67f25388621a39749c918a4efe98"]:
{{{
#!CommitTicketReference repository=""
revision="2a2ac5c1400c67f25388621a39749c918a4efe98"


Merge pull request #1566 from adamsc64/ticket_11857

Fixed #11857 -- Added missing 'closed' property on TemporaryFile class.

Backport of 926bc42 from trunk.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/11857#comment:35>

Reply all
Reply to author
Forward
0 new messages