[Python-Dev] Bug [ 959379 ] Implicit close() should check for errors (original) (raw)
Peter Astrand astrand at lysator.liu.se
Sun Oct 24 23:11:40 CEST 2004
- Previous message: [Python-Dev] Re: [Python-checkins] python/dist/src/Pythoncompile.c, 2.330, 2.331
- Next message: [Python-Dev] Re: Bug [ 959379 ] Implicit close() should check for errors
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'd like to resolve bug 959379. Here's a naive fix. Comments?
diff -u -r2.192 fileobject.c --- Objects/fileobject.c 11 Jun 2004 04:49:03 -0000 2.192 +++ Objects/fileobject.c 24 Oct 2004 20:58:49 -0000 @@ -304,7 +304,8 @@ PyObject_ClearWeakRefs((PyObject *) f); if (f->f_fp != NULL && f->f_close != NULL) { Py_BEGIN_ALLOW_THREADS
(*f->f_close)(f->f_fp);
if ((*f->f_close)(f->f_fp) != 0)
perror("close failed"); Py_END_ALLOW_THREADS } PyMem_Free(f->f_setbuf);
/Peter Åstrand <astrand at lysator.liu.se>
- Previous message: [Python-Dev] Re: [Python-checkins] python/dist/src/Pythoncompile.c, 2.330, 2.331
- Next message: [Python-Dev] Re: Bug [ 959379 ] Implicit close() should check for errors
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]