Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions stdlib/@tests/stubtest_allowlists/darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ multiprocessing.popen_spawn_win32
os.SCHED_[A-Z_]+
posix.SCHED_[A-Z_]+

# Some of these exist on non-windows, but they are useless and this is not intended
stat.FILE_ATTRIBUTE_[A-Z_]+

# Methods that come from __getattr__() at runtime
tkinter.Tk.createfilehandler
tkinter.Tk.deletefilehandler
Expand Down
3 changes: 0 additions & 3 deletions stdlib/@tests/stubtest_allowlists/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ posix.SCHED_[A-Z_]+
(posix.ST_[A-Z]+)?
(termios.[A-Z0-9_]+)?

# Some of these exist on non-windows, but they are useless and this is not intended
stat.FILE_ATTRIBUTE_[A-Z_]+

# Methods that come from __getattr__() at runtime
tkinter.Tk.createfilehandler
tkinter.Tk.deletefilehandler
Expand Down
21 changes: 21 additions & 0 deletions stdlib/stat.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,24 @@ from typing import Final
if sys.version_info >= (3, 13):
# https://github.com/python/cpython/issues/114081#issuecomment-2119017790
SF_RESTRICTED: Final = 0x00080000

if sys.platform != "win32":
# Available in stat but not in _stat
# Locking behind platform check to avoid redefinitions
FILE_ATTRIBUTE_ARCHIVE: Final = 32
FILE_ATTRIBUTE_COMPRESSED: Final = 2048
FILE_ATTRIBUTE_DEVICE: Final = 64
FILE_ATTRIBUTE_DIRECTORY: Final = 16
FILE_ATTRIBUTE_ENCRYPTED: Final = 16384
FILE_ATTRIBUTE_HIDDEN: Final = 2
FILE_ATTRIBUTE_INTEGRITY_STREAM: Final = 32768
FILE_ATTRIBUTE_NORMAL: Final = 128
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: Final = 8192
FILE_ATTRIBUTE_NO_SCRUB_DATA: Final = 131072
FILE_ATTRIBUTE_OFFLINE: Final = 4096
FILE_ATTRIBUTE_READONLY: Final = 1
FILE_ATTRIBUTE_REPARSE_POINT: Final = 1024
FILE_ATTRIBUTE_SPARSE_FILE: Final = 512
FILE_ATTRIBUTE_SYSTEM: Final = 4
FILE_ATTRIBUTE_TEMPORARY: Final = 256
FILE_ATTRIBUTE_VIRTUAL: Final = 65536