[issue30980] Calling asyncore.file_wrapper.close twice may close unrelated file descriptor

2017-07-26 Thread STINNER Victor

Changes by STINNER Victor :


--
components: +Library (Lib)
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> behavior
versions:  -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30980] Calling asyncore.file_wrapper.close twice may close unrelated file descriptor

2017-07-26 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 25de5baf3eaebddbf879aacf49c0f614f922dc42 by Victor Stinner (Nir 
Soffer) in branch '3.6':
bpo-30980: Fix double close in asyncore.file_wrapper (#2789) (#2898)
https://github.com/python/cpython/commit/25de5baf3eaebddbf879aacf49c0f614f922dc42


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30980] Calling asyncore.file_wrapper.close twice may close unrelated file descriptor

2017-07-26 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 29094cec7cddd561cac16ce93443ca72d740de4d by Victor Stinner (Nir 
Soffer) in branch '2.7':
bpo-30980: Fix double close in asyncore.file_wrapper (#2789) (#2900)
https://github.com/python/cpython/commit/29094cec7cddd561cac16ce93443ca72d740de4d


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30980] Calling asyncore.file_wrapper.close twice may close unrelated file descriptor

2017-07-26 Thread Nir Soffer

Changes by Nir Soffer :


--
pull_requests: +2952

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30980] Calling asyncore.file_wrapper.close twice may close unrelated file descriptor

2017-07-26 Thread Nir Soffer

Changes by Nir Soffer :


--
pull_requests: +2951

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30980] Calling asyncore.file_wrapper.close twice may close unrelated file descriptor

2017-07-26 Thread Nir Soffer

Changes by Nir Soffer :


--
pull_requests: +2950

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30980] Calling asyncore.file_wrapper.close twice may close unrelated file descriptor

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:

Thanks for your fix Nir Soffer!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30980] Calling asyncore.file_wrapper.close twice may close unrelated file descriptor

2017-07-24 Thread STINNER Victor

STINNER Victor added the comment:


New changeset c648a93ae342ac28d2abbb100161eae4f907d001 by Victor Stinner (Nir 
Soffer) in branch 'master':
bpo-30980: Fix double close in asyncore.file_wrapper (#2789)
https://github.com/python/cpython/commit/c648a93ae342ac28d2abbb100161eae4f907d001


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30980] Calling asyncore.file_wrapper.close twice may close unrelated file descriptor

2017-07-20 Thread STINNER Victor

Changes by STINNER Victor :


--
versions:  -Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30980] Calling asyncore.file_wrapper.close twice may close unrelated file descriptor

2017-07-20 Thread Nir Soffer

Changes by Nir Soffer :


--
pull_requests: +2839

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30980] Calling asyncore.file_wrapper.close twice may close unrelated file descriptor

2017-07-20 Thread Nir Soffer

New submission from Nir Soffer:

Commit 4d4c69dc35154a9c21fed1b6b4088e741fbc6ae6 added protection for double 
close in file_wrapper.close, but the test did not consider that fact that 
file_wrapper is dupping the file descriptor, making the test ineffective.

>>> fd1, fd2 = os.pipe()
>>> f = asyncore.file_wrapper(fd1)
>>> os.close(f.fd)
>>> f.close()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python3.5/asyncore.py", line 621, in close
os.close(self.fd)
OSError: [Errno 9] Bad file descriptor
>>> f.fd
4
>>> fd3, fd4 = os.pipe()
>>> fd3
4
>>> f.close()
>>> os.close(fd3)
Traceback (most recent call last):
  File "", line 1, in 
OSError: [Errno 9] Bad file descriptor

f.close() closed an unrelated file descriptor.

--
messages: 298753
nosy: Nir Soffer, haypo
priority: normal
severity: normal
status: open
title: Calling asyncore.file_wrapper.close twice may close unrelated file 
descriptor
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com