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