| 1354 | sys.platform == "emscripten", reason="umask doesn't work on Emscripten" |
| 1355 | ) |
| 1356 | def test_native_file_permissions(tmpdir): |
| 1357 | # ARROW-10124: permissions of created files should follow umask |
| 1358 | cur_umask = os.umask(0o002) |
| 1359 | os.umask(cur_umask) |
| 1360 | |
| 1361 | path = os.path.join(str(tmpdir), guid()) |
| 1362 | with pa.OSFile(path, mode='w'): |
| 1363 | pass |
| 1364 | assert os.stat(path).st_mode & 0o777 == 0o666 & ~cur_umask |
| 1365 | |
| 1366 | path = os.path.join(str(tmpdir), guid()) |
| 1367 | with pa.memory_map(path, 'w'): |
| 1368 | pass |
| 1369 | assert os.stat(path).st_mode & 0o777 == 0o666 & ~cur_umask |
| 1370 | |
| 1371 | |
| 1372 | def test_native_file_raises_ValueError_after_close(tmpdir): |