Message394208
Opening a file calls `isatty` which calls an ioctl with the GIL held.
GDB:
```
#0 __GI___tcgetattr (fd=18, termios_p=termios_p@entry=0x7f618a5df920)
at ../sysdeps/unix/sysv/linux/tcgetattr.c:38
#1 0x00007f618bd1ca0c in __isatty (fd=<optimized out>) at ../sysdeps/posix/isatty.c:27
#2 0x000000000062b746 in _Py_device_encoding (fd=<optimized out>) at ../Python/fileutils.c:62
#3 0x000000000060bf90 in _io_TextIOWrapper___init___impl (write_through=0, line_buffering=0,
newline=0x0, errors='strict', encoding=<optimized out>,
buffer=<_io.BufferedWriter at remote 0x7f618986aeb0>, self=0x7f618985a860)
at ../Modules/_io/textio.c:1149
...
```
Please don't do that.
In my case, the file in question is implemented as a FUSE mount which is served by the same process (different thread of course). Thus holding the GIL at this point causes a rather interesting deadlock.
Tested with 3.9. |
|
Date |
User |
Action |
Args |
2021-05-23 17:18:13 | smurfix | set | recipients:
+ smurfix |
2021-05-23 17:18:13 | smurfix | set | messageid: <1621790293.8.0.271052485401.issue44219@roundup.psfhosted.org> |
2021-05-23 17:18:13 | smurfix | link | issue44219 messages |
2021-05-23 17:18:13 | smurfix | create | |
|