[issue33773] test.support.fd_count(): off-by-one error when listing /proc/self/fd/

2018-06-06 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue33773] test.support.fd_count(): off-by-one error when listing /proc/self/fd/

2018-06-06 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 67b7158d53f33ed644cc11ef394470a859ea8bad by Victor Stinner in 
branch '2.7':
bpo-33773: Fix test.support.fd_count() on Linux/FreBSD (GH-7421) (GH-7456)
https://github.com/python/cpython/commit/67b7158d53f33ed644cc11ef394470a859ea8bad


--

___
Python tracker 

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



[issue33773] test.support.fd_count(): off-by-one error when listing /proc/self/fd/

2018-06-06 Thread miss-islington


miss-islington  added the comment:


New changeset 97fe1b493df979956c66c57095bc7fce22104faf by Miss Islington (bot) 
in branch '3.6':
bpo-33773: Fix test.support.fd_count() on Linux/FreBSD (GH-7421)
https://github.com/python/cpython/commit/97fe1b493df979956c66c57095bc7fce22104faf


--

___
Python tracker 

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



[issue33773] test.support.fd_count(): off-by-one error when listing /proc/self/fd/

2018-06-06 Thread miss-islington


miss-islington  added the comment:


New changeset 016aff77cbf5f63ed051a98ac628522a1cfd40a4 by Miss Islington (bot) 
in branch '3.7':
bpo-33773: Fix test.support.fd_count() on Linux/FreBSD (GH-7421)
https://github.com/python/cpython/commit/016aff77cbf5f63ed051a98ac628522a1cfd40a4


--
nosy: +miss-islington

___
Python tracker 

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



[issue33773] test.support.fd_count(): off-by-one error when listing /proc/self/fd/

2018-06-06 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +7079

___
Python tracker 

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



[issue33773] test.support.fd_count(): off-by-one error when listing /proc/self/fd/

2018-06-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7078

___
Python tracker 

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



[issue33773] test.support.fd_count(): off-by-one error when listing /proc/self/fd/

2018-06-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +7077

___
Python tracker 

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



[issue33773] test.support.fd_count(): off-by-one error when listing /proc/self/fd/

2018-06-06 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 492d6424a7ca907c8ec1df21e51062e8f3d88e32 by Victor Stinner in 
branch 'master':
bpo-33773: Fix test.support.fd_count() on Linux/FreBSD (GH-7421)
https://github.com/python/cpython/commit/492d6424a7ca907c8ec1df21e51062e8f3d88e32


--

___
Python tracker 

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



[issue33773] test.support.fd_count(): off-by-one error when listing /proc/self/fd/

2018-06-05 Thread STINNER Victor


STINNER Victor  added the comment:

fd_count() has been added by bpo-18174. I just backported it to Python 2.7 to 
check for leak of file descriptors in tests. I found the bug when I fixed a bug 
on Python 2.7 on FreeBSD.

--

___
Python tracker 

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



[issue33773] test.support.fd_count(): off-by-one error when listing /proc/self/fd/

2018-06-05 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +7046
stage:  -> patch review

___
Python tracker 

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



[issue33773] test.support.fd_count(): off-by-one error when listing /proc/self/fd/

2018-06-05 Thread STINNER Victor


New submission from STINNER Victor :

test.support.fd_count() has two implementation: list /proc/self/fd/ on Linux 
and FreeBSD, or check all file descriptors from 0 and MAXFD. The problem is 
that the two implementation don't give the same result...

List /proc/self/fd/ (used by default on Linux):

vstinner@apu$ ./python -c 'from test.support import fd_count; print(fd_count())'
4

Check all FD (I modified fd_count() to force using this implementation):

vstinner@apu$ ./python -c 'from test.support import fd_count; print(fd_count())'
3

On Linux and FreeBSD, listdir() opens internally a file descriptor to list the 
content of the /proc/self/fd/ directory. So the function should substract one 
to the result.

Attached PR fixes the issue.

--
components: Tests
messages: 318734
nosy: pitrou, vstinner
priority: normal
severity: normal
status: open
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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