Skip to content

Commit

Permalink
Fix OSError in tmpdir on emscripten due to missing getuid()
Browse files Browse the repository at this point in the history
  • Loading branch information
rdb committed Feb 24, 2023
1 parent 9ccae9a commit c237297
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/10765.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix temp_path fixture always raising OSError on emscripten due to missing getuid
2 changes: 1 addition & 1 deletion src/_pytest/tmpdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def getbasetemp(self) -> Path:
# Also, to keep things private, fixup any world-readable temp
# rootdir's permissions. Historically 0o755 was used, so we can't
# just error out on this, at least for a while.
if sys.platform != "win32":
if sys.platform != "win32" and sys.platform != "emscripten":
uid = os.getuid()
rootdir_stat = rootdir.stat()
# getuid shouldn't fail, but cpython defines such a case.
Expand Down

0 comments on commit c237297

Please sign in to comment.