[issue15948] Unchecked return value of I/O functions

2016-03-07 Thread Марк Коренберг
Марк Коренберг added the comment: In a common case, if (write(thread.fd, thread.header, thread.header_len) == -1) should be replaced with if (write(thread.fd, thread.header, thread.header_len) != thread.header_len) -- nosy: +mmarkk ___ Python

[issue15948] Unchecked return value of I/O functions

2016-03-06 Thread Berker Peksag
Changes by Berker Peksag : -- dependencies: +Missing sanity checks for various C library function calls... ___ Python tracker

[issue15948] Unchecked return value of I/O functions

2015-04-04 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- dependencies: +Failure to check return value from lseek() in Modules/mmapmodule.c ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15948

[issue15948] Unchecked return value of I/O functions

2013-01-15 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15948 ___ ___ Python-bugs-list mailing list

[issue15948] Unchecked return value of I/O functions

2013-01-10 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15948 ___ ___

[issue15948] Unchecked return value of I/O functions

2013-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Some general notes. Nitpick: check foo() 0 is more used than foo() == 0. An exception raised after failed close() can hide original exception raised before. I left more specific comments on Rietveld. Only a small part of the proposed changes may be

[issue15948] Unchecked return value of I/O functions

2013-01-10 Thread Marek Šuppa
Marek Šuppa added the comment: Thanks for the review. Do you think I should split it into multiple patches to make it easier to look through? It might be that some changes are completely wrong. This is the first time I did something with cpython core code. --

[issue15948] Unchecked return value of I/O functions

2013-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, I forgot press Push All My Drafts button. Actually only patch for _cursesmodule.c looks safe at first glance (but curses maintainer can decide better). You can split the patch on several patches, but be very careful. You should research the entire

[issue15948] Unchecked return value of I/O functions

2013-01-10 Thread Marek Šuppa
Marek Šuppa added the comment: That is probably right. I was way too foolish to start with this but won't stop now. I'll try to iterate on your feedback. Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15948

[issue15948] Unchecked return value of I/O functions

2013-01-10 Thread STINNER Victor
STINNER Victor added the comment: ./Python/traceback.c:write(fd, c, 1); ./Python/traceback.c:write(fd, \, 1); ./Python/traceback.c:write(fd, \, 1); ./Python/traceback.c:write(fd, \n, 1); ./Python/traceback.c:write(fd, \n, 1); Oh, I wrote these ones.

[issue15948] Unchecked return value of I/O functions

2013-01-10 Thread STINNER Victor
STINNER Victor added the comment: diff -r 0acc5626a578 Modules/faulthandler.c @@ -445,7 +445,10 @@ -write(thread.fd, thread.header, thread.header_len); +if (write(thread.fd, thread.header, thread.header_len) == -1) { +PyErr_SetFromErrno(PyExc_IOError); +

[issue15948] Unchecked return value of I/O functions

2013-01-09 Thread John O'Connor
Changes by John O'Connor tehj...@gmail.com: -- nosy: +jcon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15948 ___ ___ Python-bugs-list mailing

[issue15948] Unchecked return value of I/O functions

2012-12-30 Thread Marek Šuppa
Marek Šuppa added the comment: Any update on this? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15948 ___ ___ Python-bugs-list mailing list

[issue15948] Unchecked return value of I/O functions

2012-12-30 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15948 ___ ___

[issue15948] Unchecked return value of I/O functions

2012-12-07 Thread Marek Šuppa
Marek Šuppa added the comment: Hi, Sorry for the long delay. The attached patch should fix all the relevant occurrences of I/O functions I was able to find. Please review. Thanks! -- Added file: http://bugs.python.org/file28253/unchecked_return_values.patch

[issue15948] Unchecked return value of I/O functions

2012-10-28 Thread Berker Peksag
Berker Peksag added the comment: There is a typo in the command: s/fwite/fwrite/. ./Objects/object.c:fwrite(PyBytes_AS_STRING(s), 1, ./Objects/object.c:fwrite(PyBytes_AS_STRING(t), 1, ./PC/bdist_wininst/install.c:fwrite(arc_data, exe_size, 1, fp);

[issue15948] Unchecked return value of I/O functions

2012-10-24 Thread Marek Šuppa
Marek Šuppa added the comment: Since there is probably a lot to work on here I'd also like to participate. I've got one question though. In case these function don't return 0 and the test fails what should happen then? What kind of error should be thrown for let's say fseek() ? --

[issue15948] Unchecked return value of I/O functions

2012-10-24 Thread Christian Heimes
Christian Heimes added the comment: The functions should set an appropriate errno so it's PyErr_SetFromErrno(PyExc_IOError). You should use the PyErr_SetFromErrnoWithFilename*() variants when a file name (PyObject*, char*, unicode) is available. --

[issue15948] Unchecked return value of I/O functions

2012-10-24 Thread Marek Šuppa
Marek Šuppa added the comment: Thanks for a quick response. Should we also test this somewhere? Christian Heimes rep...@bugs.python.org wrote: Christian Heimes added the comment: The functions should set an appropriate errno so it's PyErr_SetFromErrno(PyExc_IOError). You should use the

[issue15948] Unchecked return value of I/O functions

2012-10-24 Thread Marek Šuppa
Marek Šuppa added the comment: Appended is the patch for _cursesmodule.c Let me know if it's OK. -- keywords: +patch Added file: http://bugs.python.org/file27692/issue15948__cursesmodule.patch ___ Python tracker rep...@bugs.python.org

[issue15948] Unchecked return value of I/O functions

2012-09-15 Thread Christian Heimes
New submission from Christian Heimes: Python's C code contains more than 30 lines that don't check the return value of I/O functions like fseek(). A missing check can hide issues like a failing NFS connection. I've created an (incomplete) list of missing checks with find and grep. $ find

[issue15948] Unchecked return value of I/O functions

2012-09-15 Thread Felipe Cruz
Felipe Cruz added the comment: I can submit patches.. Is there any problem to send 1 patch per module? -- nosy: +felipecruz ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15948 ___

[issue15948] Unchecked return value of I/O functions

2012-09-15 Thread Ezio Melotti
Ezio Melotti added the comment: I think that's OK. -- nosy: +ezio.melotti stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15948 ___