SIGN IN SIGN UP

bpo-30980: Fix double close in asyncore.file_wrapper (#2789)

* bpo-30980: Fix close test to fail

test_close_twice was not considering the fact that file_wrapper is
duping the file descriptor. Closing the original descriptor left the
duped one open, hiding the fact that close protection is not effective.

* bpo-30980: Fix double close protection

Invalidated self.fd before closing, handling correctly the case when
os.close raises.

* bpo-30980: Fix fd leak introduced in the fixed test
N
Nir Soffer committed
c648a93ae342ac28d2abbb100161eae4f907d001
Parent: 5b4feb7
Committed by Victor Stinner <victor.stinner@gmail.com> on 7/24/2017, 9:18:06 PM