We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72f4d4d commit 77778a3Copy full SHA for 77778a3
src/xopen/__init__.py
@@ -732,7 +732,8 @@ def _filepath_from_path_or_filelike(fileorpath: FileOrPath) -> str:
732
def _file_is_a_socket_or_pipe(filepath):
733
try:
734
mode = os.stat(filepath).st_mode
735
- return stat.S_ISFIFO(mode) or stat.S_ISSOCK(mode) or stat.S_ISPORT(mode)
+ # Treat anything that is not a regular file as special
736
+ return not stat.S_ISREG(mode)
737
except (OSError, TypeError): # Type error for unexpected types in stat.
738
return False
739
0 commit comments