HyukjinKwon commented on code in PR #39603:
URL: https://github.com/apache/spark/pull/39603#discussion_r1071108421
##########
python/setup.py:
##########
@@ -104,7 +105,7 @@
def _supports_symlinks():
"""Check if the system supports symlinks (e.g. *nix) or not."""
- return getattr(os, "symlink", None) is not None
+ return getattr(os, "symlink", None) is not None and
ctypes.windll.shell32.IsUserAnAdmin() != 0 if sys.platform == "win32" else True
Review Comment:
You will have to do something like this to minimize the potential breakage:
```suggestion
return hasattr(os, "symlink") and (
(not hasattr(ctypes, "windll")) # Non-Windows
or (
# In some Windows, `os.symlink` works only for admins.
hasattr(ctypes, "windll")
and hasattr(ctypes.windll, "shell32")
and hasattr(ctypes.windll.shell32, "IsUserAnAdmin")
and ctypes.windll.shell32.IsUserAnAdmin() != 0
)
)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]