summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-04-02 17:20:44 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-04-02 17:23:46 +0300
commite5fa163a4c02531a5f4e49669b66b09fd1ea2785 (patch)
treeb8f09649ad899ec2222f6721707628aa218f4ba5
parenta0cb4eda9a6faef109f64da39e441f2b11afc872 (diff)
unix/file: Parse "buffering" argument of open() builtin.
It's ignored (unbuffered, raw I/O is used), but least makes it compatible with CPython.
-rw-r--r--unix/file.c1
-rw-r--r--unix/qstrdefsport.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/unix/file.c b/unix/file.c
index db15f244f..813f97fd2 100644
--- a/unix/file.c
+++ b/unix/file.c
@@ -148,6 +148,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(fdfile_fileno_obj, fdfile_fileno);
STATIC const mp_arg_t file_open_args[] = {
{ MP_QSTR_file, MP_ARG_OBJ | MP_ARG_REQUIRED, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj)} },
{ MP_QSTR_mode, MP_ARG_OBJ, {.u_obj = MP_OBJ_NEW_QSTR(MP_QSTR_r)} },
+ { MP_QSTR_buffering, MP_ARG_OBJ, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj)} },
{ MP_QSTR_encoding, MP_ARG_OBJ | MP_ARG_KW_ONLY, {.u_rom_obj = MP_ROM_PTR(&mp_const_none_obj)} },
};
#define FILE_OPEN_NUM_ARGS MP_ARRAY_SIZE(file_open_args)
diff --git a/unix/qstrdefsport.h b/unix/qstrdefsport.h
index 3aceb331f..36126a3b2 100644
--- a/unix/qstrdefsport.h
+++ b/unix/qstrdefsport.h
@@ -30,6 +30,7 @@ Q(Test)
Q(fileno)
Q(makefile)
+Q(buffering)
Q(FileIO)
Q(flush)