From 63b9e598a35e19ea87ea9de7831ec4fde75def8c Mon Sep 17 00:00:00 2001
From: Ari Suutari <ari@stonepile.fi>
Date: Thu, 18 Jun 2015 16:05:44 +0300
Subject: [PATCH] unix: Add O_WRONLY | O_CREAT to open call when opening file
 for append ("a").

To comply with Python semantics.
---
 unix/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/unix/file.c b/unix/file.c
index dfe2d6e11..a7886fd3c 100644
--- a/unix/file.c
+++ b/unix/file.c
@@ -161,7 +161,7 @@ STATIC mp_obj_t fdfile_open(mp_obj_t type_in, mp_arg_val_t *args) {
                 mode |= O_WRONLY | O_CREAT | O_TRUNC;
                 break;
             case 'a':
-                mode |= O_APPEND;
+                mode |= O_WRONLY | O_CREAT | O_APPEND;
                 break;
             case '+':
                 mode |= O_RDWR;
-- 
GitLab