mirror of
https://github.com/python/cpython.git
synced 2025-09-18 06:30:38 +00:00
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.
This commit is contained in:
parent
007a618a38
commit
bb445a1f22
6 changed files with 77 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue