Message317791
This is fairly odd behaviour of macOS, the same error can be seen from a bash session:
$ stat /dev/fd/3
stat: /dev/fd/3: stat: Bad file descriptor
The reason os.walk() works while the Path().is_file doesn't is that os.walk() explicitly guards against OSError exceptions raised by os.stat().
Looking at the documentation this could be seen as a bug in macOS, as the manual page for stat(2) doesn't mention EBADF as a valid error for this system call.
I'm not sure at this point if we should add a workaround for this. An actual patch would be easy enough, "just" add EBADF to the list of ignored errno values in the implementation of is_file (and related method) in pathlib.py |
|
Date |
User |
Action |
Args |
2018-05-27 11:17:24 | ronaldoussoren | set | recipients:
+ ronaldoussoren, ned.deily, Victor Domingos |
2018-05-27 11:17:24 | ronaldoussoren | set | messageid: <1527419844.23.0.682650639539.issue33635@psf.upfronthosting.co.za> |
2018-05-27 11:17:24 | ronaldoussoren | link | issue33635 messages |
2018-05-27 11:17:24 | ronaldoussoren | create | |
|