[issue32345] EIO from write() is only fatal if print() contains a newline

2017-12-25 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +vstinner ___ Python tracker ___ ___

[issue32345] EIO from write() is only fatal if print() contains a newline

2017-12-20 Thread Creideiki
Creideiki added the comment: I ran this program: #include #include #include #include void print(const char *s, size_t l) { errno = 0; fwrite(s, l, 1, stdout); int saved_errno = errno; fprintf(stderr, "After \"%s\": ferror(): %i,

[issue32345] EIO from write() is only fatal if print() contains a newline

2017-12-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think the difference here is that Python calls ferror() to tell whether an error occurred on the underlying FILE*. Can you adapt your C program to check ferror()? -- ___ Python tracker

[issue32345] EIO from write() is only fatal if print() contains a newline

2017-12-20 Thread Creideiki
Creideiki added the comment: Hmm. Yes and no; you seem to be correct in that the problem is on the libc level, but Python definitely does something special. By the way, this is glibc 2.26. I tried this C program: #include #include int main() {

[issue32345] EIO from write() is only fatal if print() contains a newline

2017-12-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Python 2 doesn't call write(), it calls fwrite() and friends (i.e. it uses the libc's buffered I/O API). Also we don't do anything special if the printed string has a newline in it. So my guess is that it's a bug in the libc. --

[issue32345] EIO from write() is only fatal if print() contains a newline

2017-12-16 Thread Creideiki
New submission from Creideiki : This is Python 2.7.14 on Gentoo Linux. I ran into an issue where a program crashes if I run it from a terminal, put it in the background, and then close the terminal too soon. Upstream bug report: