stephanelsmith
1c047742a2
extmod/vfs_posix_file: Fix flush handling on macOS.
...
On macOS, if running micropython from subprocess.check_output, then a
stdout.flush() raises error 45.
Here's a test case. This will run fine on linux, but crashes on macOS with
error 45.
import sys
import subprocess
import tempfile
with tempfile.NamedTemporaryFile('w') as fp:
fp.write('''
import sys
sys.stdout.write('hello world')
sys.stdout.flush()
print('')
''')
fp.flush()
print('py3')
o = subprocess.check_output(f'python3 {fp.name}'.split())
print(o)
print('upy')
o = subprocess.check_output(f'micropython {fp.name}'.split())
print(o)
On macOS:
py3
b'hello world\n'
upy
Traceback (most recent call last):
File "...", line 4, in <module>
OSError: 45
On unix:
py3
b'hello world\n'
upy
b'hello world\n'
Signed-off-by: stephanelsmith <stephane.smith@titansensor.com >
2023-09-01 17:39:38 +10:00
..
2023-06-19 18:37:34 +10:00
2023-01-12 16:04:57 +11:00
2023-06-14 22:20:20 +10:00
2017-07-18 11:57:39 +10:00
2022-10-22 19:12:46 +11:00
2023-04-27 18:03:06 +10:00
2023-08-15 17:37:44 +10:00
2023-07-21 19:32:40 +10:00
2022-05-05 13:30:40 +10:00
2021-08-19 22:50:11 +10:00
2021-08-19 22:50:11 +10:00
2022-09-19 19:06:15 +10:00
2022-09-19 19:06:15 +10:00
2022-09-19 19:06:15 +10:00
2017-07-31 18:35:40 +10:00
2022-09-19 19:06:15 +10:00
2017-07-18 11:57:39 +10:00
2019-07-01 22:53:00 +10:00
2017-07-18 11:57:39 +10:00
2023-05-04 13:19:19 +10:00
2021-09-04 16:31:17 +10:00
2022-09-19 19:06:15 +10:00
2017-07-18 11:57:39 +10:00
2022-11-11 16:24:32 +11:00
2022-09-19 19:06:15 +10:00
2022-11-11 16:24:32 +11:00
2023-06-08 17:54:04 +10:00
2023-06-19 17:33:03 +10:00
2023-07-21 19:32:40 +10:00
2023-06-08 17:54:21 +10:00
2023-04-26 11:37:20 +10:00
2023-06-23 15:34:22 +10:00
2023-06-08 17:54:21 +10:00
2023-09-01 12:23:37 +10:00
2022-12-09 16:47:23 +11:00
2023-06-23 15:22:27 +10:00
2023-06-08 17:54:21 +10:00
2023-06-08 17:54:21 +10:00
2023-06-08 17:54:21 +10:00
2023-03-01 01:27:12 +11:00
2023-06-08 17:54:11 +10:00
2022-06-02 16:31:37 +10:00
2023-06-08 17:54:21 +10:00
2023-06-08 17:54:21 +10:00
2023-06-23 15:34:22 +10:00
2023-06-08 17:54:21 +10:00
2023-06-08 17:54:21 +10:00
2023-08-14 18:48:47 +10:00
2023-06-08 17:54:21 +10:00
2023-06-26 16:34:41 +10:00
2023-08-30 13:52:31 +10:00
2023-06-08 17:54:21 +10:00
2023-06-08 17:54:14 +10:00
2023-06-08 17:54:21 +10:00
2023-06-08 17:54:14 +10:00
2023-06-08 17:54:21 +10:00
2023-06-08 17:54:14 +10:00
2020-09-08 11:41:31 +10:00
2022-06-03 11:53:28 +10:00
2023-05-08 11:56:31 +10:00
2019-06-03 16:47:35 +10:00
2023-03-01 01:26:44 +11:00
2023-04-05 09:46:46 +10:00
2022-12-15 17:40:06 +11:00
2023-06-08 17:54:17 +10:00
2023-06-08 17:54:14 +10:00
2020-02-28 10:33:03 +11:00
2020-06-19 22:07:32 +10:00
2023-07-21 18:49:03 +10:00
2022-09-19 19:06:15 +10:00
2019-10-29 12:12:37 +11:00
2022-11-11 16:24:32 +11:00
2019-10-29 14:17:29 +11:00
2023-07-21 18:49:03 +10:00
2023-05-19 22:01:10 +10:00
2023-09-01 17:39:38 +10:00
2023-06-08 17:54:11 +10:00
2018-06-06 14:33:42 +10:00
2020-08-12 23:40:50 +10:00
2022-09-19 19:06:15 +10:00
2022-05-25 13:04:45 +10:00
2022-09-19 19:06:07 +10:00
2017-07-18 11:57:39 +10:00