#19905: ResourceWarning in formtools tests
-----------------------------------+------------------------------------
     Reporter:  apollo13           |                    Owner:  nobody
         Type:  Bug                |                   Status:  new
    Component:  contrib.formtools  |                  Version:  master
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Accepted
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------

Comment (by bmispelon):

 I took a peek at the tests and I'm left a bit puzzled.

 The name of the unclosed files is consistent with what happens in the test
 (lots of `open(__file__)`).

 However, I don't really understand the flow of the code: it seems some
 files are closed before being re-opened
 
(https://github.com/django/django/blob/master/django/contrib/formtools/tests/wizard/namedwizardtests/tests.py#L125-L126).

 I found commit 64a3c7f9aeda347a72e3f1e8e88381b5b3d479d8 which seems like
 an attempt to fix those issues (though the commit message is not very
 optimistic).

 I also found a line in
 `formtools.wizard.storage.base.BaseStorage.get_step_files()` which is a
 bit suspicious:
 
https://github.com/django/django/blob/master/django/contrib/formtools/wizard/storage/base.py#L81
 but I'm not familiar enough with formtools' code to tell whether that
 opened file gets closed later on.

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to