This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Arfrever, brett.cannon, eric.snow, ncoghlan, python-dev, serhiy.storchaka, vstinner
Date 2015-09-30.12:59:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1443617945.15.0.669560483564.issue25182@psf.upfronthosting.co.za>
In-reply-to
Content
> This is not related to this issue. sys.stderr uses backslashreplace.

Ok, fine.

---
+    _errno = errno;
     Py_END_ALLOW_THREADS
+    Py_XDECREF(bytes);

     if (n < 0) {
-        if (errno == EAGAIN)
+        if (_errno == EAGAIN)
             Py_RETURN_NONE;
         PyErr_SetFromErrno(PyExc_IOError);
---

Hum, if you expect that _errno can be modified by Py_XDECREF(bytes), you must restore the previous errno value before calling PyErr_SetFromErrno(). This strategy is used in Python/fileutils.c.
History
Date User Action Args
2015-09-30 12:59:05vstinnersetrecipients: + vstinner, brett.cannon, ncoghlan, Arfrever, python-dev, eric.snow, serhiy.storchaka
2015-09-30 12:59:05vstinnersetmessageid: <1443617945.15.0.669560483564.issue25182@psf.upfronthosting.co.za>
2015-09-30 12:59:05vstinnerlinkissue25182 messages
2015-09-30 12:59:04vstinnercreate