[issue21772] platform.uname() not EINTR safe

STINNER Victor report at bugs.python.org
Mon Jun 16 23:30:05 CEST 2014


STINNER Victor added the comment:

> Calling f.read() on naked os.open() output can produce "IOError: [Errno 4] Interrupted system call". Attached is a suggested fix.

I cannot reproduce your issue. What is your exact Python version and OS?

I tried to run 100 threads calling 100 times platform._syscmd_uname('-p'). I didn't reproduce the issue on Python 2.7 or 3.5.

---
import platform
import threading

def test():
    for x in range(100):
        p = platform._syscmd_uname('-p')

threads = [threading.Thread(target=test) for n in range(100)]
for thread in threads:
    thread.start()
for thread in threads:
    thread.join()
---

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21772>
_______________________________________


More information about the Python-bugs-list mailing list