[issue44219] Opening a file holds the GIL when it calls "isatty()"

Vincent Michel report at bugs.python.org
Thu Sep 9 06:05:25 EDT 2021


Vincent Michel <vxgmichel at gmail.com> added the comment:

There are a couple of reasons why I did not make changes to the stdstream related functions. 

The first one is that a PR with many changes is less likely to get reviewed and merged than a PR with fewer changes. The second one is that it's hard for me to make sure that those functions are always called with the GIL already held. Maybe some of them never hold the GIL in the first place, and I'm not familiar enough with the code base to tell.

So in the end it will probably be up to the coredev reviewing the PR, but better start small.

> Besides, nothing prevents somebody from starting a FUSE file system and then redirecting stdout to it …

I ran some checks and `python -c 'input()' < my-fuse-mountpoint/data_in` does indeed trigger an ioctl call to the corresponding fuse file system. But how would `my-fuse-mountpoint/data_in` be the stdin for the process that itself starts the fuse filesystem? I don't see how to generate this deadlock, apart from setting up interprocess communication between the fuse process and the `my-fuse-mountpoint/data_in`-as-stdin process.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44219>
_______________________________________


More information about the Python-bugs-list mailing list