STINNER Victor added the comment:

Martin wrote:
> This patch looks okay to me. I left one review suggestion.

Thanks for the review, I changed this code.

While testing one more time my patch with CTRL+c, I noticed that sometimes the 
servers are not stopped properly and os.environ is not restored.

I made some extra changes to try to restore os.environ and try to close the 
server in more cases.

It's not perfect. Since unittest.TestCase.doCleanups() doesn't handle 
KeyboardInterrupt, there is no warranty that cleanup functions are always 
executed.

> Focussing on test_sending_headers(), the ResourceWarning seems to be only 
> shown since revision 46329eec5515 (Issue 26590). In simpler cases, the 
> warning would be bypassed due to Issue 19829. But in this cases it seems 
> there is a garbage cycle which may be involved in the new warning.

It's possible that Python 3.5 failed to log ResourceWarning in some cases, 
Python 3.6 should be better on this part.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26620>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to