Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10)

Delta Between Two Patch Sets: Modules/_io/fileio.c

Issue 18876: Problems with files opened in append mode with io module
Left Patch Set: Created 6 years, 5 months ago
Right Patch Set: Created 6 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Lib/test/test_fileio.py ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* Author: Daniel Stutzbach */ 1 /* Author: Daniel Stutzbach */
2 2
3 #define PY_SSIZE_T_CLEAN 3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h" 4 #include "Python.h"
5 #include "structmember.h" 5 #include "structmember.h"
6 #ifdef HAVE_SYS_TYPES_H 6 #ifdef HAVE_SYS_TYPES_H
7 #include <sys/types.h> 7 #include <sys/types.h>
8 #endif 8 #endif
9 #ifdef HAVE_SYS_STAT_H 9 #ifdef HAVE_SYS_STAT_H
10 #include <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 goto bad_mode; 312 goto bad_mode;
313 rwa = 1; 313 rwa = 1;
314 self->writable = 1; 314 self->writable = 1;
315 flags |= O_CREAT | O_TRUNC; 315 flags |= O_CREAT | O_TRUNC;
316 break; 316 break;
317 case 'a': 317 case 'a':
318 if (rwa) 318 if (rwa)
319 goto bad_mode; 319 goto bad_mode;
320 rwa = 1; 320 rwa = 1;
321 self->writable = 1; 321 self->writable = 1;
322
323 #ifdef O_APPEND
AntoinePitrou 2013/08/31 21:08:11 The original "#ifdef O_APPEND" was probably misgui
324 self->appending = 1; 322 self->appending = 1;
325 flags |= O_APPEND; 323 flags |= O_APPEND | O_CREAT;
326 #endif
327
328 flags |= O_CREAT;
329 break; 324 break;
330 case 'b': 325 case 'b':
331 break; 326 break;
332 case '+': 327 case '+':
333 if (plus) 328 if (plus)
334 goto bad_mode; 329 goto bad_mode;
335 self->readable = self->writable = 1; 330 self->readable = self->writable = 1;
336 plus = 1; 331 plus = 1;
337 break; 332 break;
338 default: 333 default:
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 0, /* tp_is_gc */ 1261 0, /* tp_is_gc */
1267 0, /* tp_bases */ 1262 0, /* tp_bases */
1268 0, /* tp_mro */ 1263 0, /* tp_mro */
1269 0, /* tp_cache */ 1264 0, /* tp_cache */
1270 0, /* tp_subclasses */ 1265 0, /* tp_subclasses */
1271 0, /* tp_weaklist */ 1266 0, /* tp_weaklist */
1272 0, /* tp_del */ 1267 0, /* tp_del */
1273 0, /* tp_version_tag */ 1268 0, /* tp_version_tag */
1274 0, /* tp_finalize */ 1269 0, /* tp_finalize */
1275 }; 1270 };
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+