8000 bpo-40280: Enable most file-at() and nanosleep APIs again (GH-32238) · python/cpython@4ed8a9a · GitHub
[go: up one dir, main page]

Skip to content

Commit 4ed8a9a

Browse files
authored
bpo-40280: Enable most file-at() and nanosleep APIs again (GH-32238)
1 parent 59be9cd commit 4ed8a9a

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

Lib/test/test_os.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1334,7 +1334,9 @@ def setUp(self):
13341334
else:
13351335
self.sub2_tree = (sub2_path, ["SUB21"], ["tmp3"])
13361336

1337-
os.chmod(sub21_path, 0)
1337+
if not support.is_emscripten:
1338+
# Emscripten fails with inaccessible directory
1339+
os.chmod(sub21_path, 0)
13381340
try:
13391341
os.listdir(sub21_path)
13401342
except PermissionError:
@@ -1517,6 +1519,9 @@ def test_yields_correct_dir_fd(self):
15171519
# check that listdir() returns consistent information
15181520
self.assertEqual(set(os.listdir(rootfd)), set(dirs) | set(files))
15191521

1522+
@unittest.skipIf(
1523+
support.is_emscripten, "Cannot dup stdout on Emscripten"
1524+
)
15201525
def test_fd_leak(self):
15211526
# Since we're opening a lot of FDs, we must be careful to avoid leaks:
15221527
# we both check that calling fwalk() a large number of times doesn't
@@ -2935,6 +2940,9 @@ def test_bad_fd(self):
29352940
@unittest.skipUnless(os.isatty(0) and not win32_is_iot() and (sys.platform.startswith('win') or
29362941
(hasattr(locale, 'nl_langinfo') and hasattr(locale, 'CODESET'))),
29372942
'test requires a tty and either Windows or nl_langinfo(CODESET)')
2943+
@unittest.skipIf(
2944+
support.is_emscripten, "Cannot get encoding of stdin on Emscripten"
2945+
)
29382946
def test_device_encoding(self):
29392947
encoding = os.device_encoding(0)
29402948
self.assertIsNotNone(encoding)

Tools/wasm/config.site-wasm32-emscripten

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,32 +27,18 @@ ac_cv_func_prlimit=no
2727
# unsupported syscall, https://github.com/emscripten-core/emscripten/issues/13393
2828
ac_cv_func_shutdown=no
2929

30-
# clock_nanosleep() causes time.sleep() to sleep forever.
31-
# nanosleep() works correctly
32-
ac_cv_func_clock_nanosleep=no
33-
ac_cv_lib_rt_clock_nanosleep=no
34-
3530
# The rest is based on pyodide
3631
# https://github.com/pyodide/pyodide/blob/main/cpython/pyconfig.undefs.h
3732

3833
ac_cv_func_epoll_create=no
3934
ac_cv_func_epoll_create1=no
4035
ac_cv_header_linux_vm_sockets_h=no
4136
ac_cv_func_socketpair=no
42-
ac_cv_func_utimensat=no
4337
ac_cv_func_sigaction=no
4438

45-
# Untested or failing syscalls in emscripten
46-
ac_cv_func_openat=no
47-
ac_cv_func_mkdirat=no
48-
ac_cv_func_faccessat=no
49-
ac_cv_func_fchownat=no
50-
ac_cv_func_renameat=no
51-
ac_cv_func_linkat=no
39+
# symlinkat is implemented, but fails
5240
ac_cv_func_symlinkat=no
53-
ac_cv_func_readlinkat=no
54-
ac_cv_func_fchmodat=no
55-
ac_cv_func_dup3=no
41+
5642
# lchmod/lchown are implemented, but fail with ENOTSUP.
5743
ac_cv_func_lchmod=no
5844
ac_cv_func_lchown=no

0 commit comments

Comments
 (0)
0