summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-11-09 20:59:14 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-11-09 20:59:14 (GMT)
commita27a150ea5f946d37e51a03e345115a227816698 (patch)
tree85a2d5b6dbb1c51034fcb5b27c8d50db4abe8ae5
parent4279346a9f23a0108714349489b9c763bbbd4e89 (diff)
downloadcpython-a27a150ea5f946d37e51a03e345115a227816698.zip
cpython-a27a150ea5f946d37e51a03e345115a227816698.tar.gz
cpython-a27a150ea5f946d37e51a03e345115a227816698.tar.bz2
open_the_file(): Explicitly set errno to 0 before calling fopen().
-rw-r--r--Objects/fileobject.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index b4f9e9b..de1a93c 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -106,6 +106,7 @@ open_the_file(PyFileObject *f, char *name, char *mode)
"file() constructor not accessible in restricted mode");
return NULL;
}
+ errno = 0;
#ifdef HAVE_FOPENRF
if (*mode == '*') {
FILE *fopenRF();