Skip to content

Commit 63b9e59

Browse files
AriZuupfalcon
authored andcommitted
unix: Add O_WRONLY | O_CREAT to open call when opening file for append ("a").
To comply with Python semantics.
1 parent 60ccb41 commit 63b9e59

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

unix/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ STATIC mp_obj_t fdfile_open(mp_obj_t type_in, mp_arg_val_t *args) {
161161
mode |= O_WRONLY | O_CREAT | O_TRUNC;
162162
break;
163163
case 'a':
164-
mode |= O_APPEND;
164+
mode |= O_WRONLY | O_CREAT | O_APPEND;
165165
break;
166166
case '+':
167167
mode |= O_RDWR;

0 commit comments

Comments
 (0)