diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-02-05 17:05:54 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-02-05 17:05:54 (GMT) |
commit | bb445a1f22835b97673f96da8f9edc75b69f5f2c (patch) | |
tree | f3d399d134896edc68edb46d5c761c385bbb20fe /Include | |
parent | 007a618a38d0c4dac9182fed9b22f3caf55dd1ea (diff) | |
download | cpython-bb445a1f22835b97673f96da8f9edc75b69f5f2c.zip cpython-bb445a1f22835b97673f96da8f9edc75b69f5f2c.tar.gz cpython-bb445a1f22835b97673f96da8f9edc75b69f5f2c.tar.bz2 |
Issue #5677: Explicitly forbid write operations on read-only file objects,
and read operations on write-only file objects. On Windows, the system C
library would return a bogus result; on Solaris, it was possible to crash
the interpreter. Patch by Stefan Krah.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/fileobject.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Include/fileobject.h b/Include/fileobject.h index 77903be..83e9c25 100644 --- a/Include/fileobject.h +++ b/Include/fileobject.h @@ -28,6 +28,8 @@ typedef struct { PyObject *weakreflist; /* List of weak references */ int unlocked_count; /* Num. currently running sections of code using f_fp with the GIL released. */ + int readable; + int writable; } PyFileObject; PyAPI_DATA(PyTypeObject) PyFile_Type; |