| 1387 | sys.platform == "emscripten", reason="umask doesn't work on Emscripten" |
| 1388 | ) |
| 1389 | def test_native_file_permissions(tmpdir): |
| 1390 | # ARROW-10124: permissions of created files should follow umask |
| 1391 | cur_umask = os.umask(0o002) |
| 1392 | os.umask(cur_umask) |
| 1393 | |
| 1394 | path = os.path.join(str(tmpdir), guid()) |
| 1395 | with pa.OSFile(path, mode='w'): |
| 1396 | pass |
| 1397 | assert os.stat(path).st_mode & 0o777 == 0o666 & ~cur_umask |
| 1398 | |
| 1399 | path = os.path.join(str(tmpdir), guid()) |
| 1400 | with pa.memory_map(path, 'w'): |
| 1401 | pass |
| 1402 | assert os.stat(path).st_mode & 0o777 == 0o666 & ~cur_umask |
| 1403 | |
| 1404 | |
| 1405 | def test_native_file_raises_ValueError_after_close(tmpdir): |