Re: [pylons-discuss] Re: tracking down a test issue - ResourceWarning: unclosed file <_io.BufferedRandom

2020-02-05 Thread Jonathan Vanasco
On Wednesday, February 5, 2020 at 1:15:23 PM UTC-5, Michael Merickel wrote: > > If you're opening files you should use the context manager - for example: > > with request.POST['file'] as field: > data = field.file.read() > Thanks, Michael. My application code did that... but somewhere in the

Re: [pylons-discuss] Re: tracking down a test issue - ResourceWarning: unclosed file <_io.BufferedRandom

2020-02-05 Thread Michael Merickel
If you're opening files you should use the context manager - for example: with request.POST['file'] as field: data = field.file.read() On Tue, Feb 4, 2020 at 3:53 PM Jonathan Vanasco wrote: > After even more testing (half my day!)... > > My app needed an `add_finished_callback` to close

[pylons-discuss] Re: tracking down a test issue - ResourceWarning: unclosed file <_io.BufferedRandom

2020-02-04 Thread Jonathan Vanasco
After even more testing (half my day!)... My app needed an `add_finished_callback` to close any `webob.compat.cgi_FieldStorage` objects in forms. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop