diff --git a/stdlib/_stat.pyi b/stdlib/_stat.pyi index 0f41381003fe..83d832e4dd8e 100644 --- a/stdlib/_stat.pyi +++ b/stdlib/_stat.pyi @@ -82,3 +82,22 @@ if sys.platform == "win32" and sys.version_info >= (3, 8): IO_REPARSE_TAG_SYMLINK: int IO_REPARSE_TAG_MOUNT_POINT: int IO_REPARSE_TAG_APPEXECLINK: int + +if sys.platform == "win32": + FILE_ATTRIBUTE_ARCHIVE: Literal[32] + FILE_ATTRIBUTE_COMPRESSED: Literal[2048] + FILE_ATTRIBUTE_DEVICE: Literal[64] + FILE_ATTRIBUTE_DIRECTORY: Literal[16] + FILE_ATTRIBUTE_ENCRYPTED: Literal[16384] + FILE_ATTRIBUTE_HIDDEN: Literal[2] + FILE_ATTRIBUTE_INTEGRITY_STREAM: Literal[32768] + FILE_ATTRIBUTE_NORMAL: Literal[128] + FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: Literal[8192] + FILE_ATTRIBUTE_NO_SCRUB_DATA: Literal[131072] + FILE_ATTRIBUTE_OFFLINE: Literal[4096] + FILE_ATTRIBUTE_READONLY: Literal[1] + FILE_ATTRIBUTE_REPARSE_POINT: Literal[1024] + FILE_ATTRIBUTE_SPARSE_FILE: Literal[512] + FILE_ATTRIBUTE_SYSTEM: Literal[4] + FILE_ATTRIBUTE_TEMPORARY: Literal[256] + FILE_ATTRIBUTE_VIRTUAL: Literal[65536] diff --git a/stdlib/stat.pyi b/stdlib/stat.pyi index ca2b33d4d9da..4518acb5a162 100644 --- a/stdlib/stat.pyi +++ b/stdlib/stat.pyi @@ -1,21 +1 @@ -from typing_extensions import Literal - from _stat import * - -FILE_ATTRIBUTE_ARCHIVE: Literal[32] -FILE_ATTRIBUTE_COMPRESSED: Literal[2048] -FILE_ATTRIBUTE_DEVICE: Literal[64] -FILE_ATTRIBUTE_DIRECTORY: Literal[16] -FILE_ATTRIBUTE_ENCRYPTED: Literal[16384] -FILE_ATTRIBUTE_HIDDEN: Literal[2] -FILE_ATTRIBUTE_INTEGRITY_STREAM: Literal[32768] -FILE_ATTRIBUTE_NORMAL: Literal[128] -FILE_ATTRIBUTE_NOT_CONTENT_INDEXED: Literal[8192] -FILE_ATTRIBUTE_NO_SCRUB_DATA: Literal[131072] -FILE_ATTRIBUTE_OFFLINE: Literal[4096] -FILE_ATTRIBUTE_READONLY: Literal[1] -FILE_ATTRIBUTE_REPARSE_POINT: Literal[1024] -FILE_ATTRIBUTE_SPARSE_FILE: Literal[512] -FILE_ATTRIBUTE_SYSTEM: Literal[4] -FILE_ATTRIBUTE_TEMPORARY: Literal[256] -FILE_ATTRIBUTE_VIRTUAL: Literal[65536] diff --git a/tests/stubtest_allowlists/darwin.txt b/tests/stubtest_allowlists/darwin.txt index afbf806e361e..aa8a3342d1f7 100644 --- a/tests/stubtest_allowlists/darwin.txt +++ b/tests/stubtest_allowlists/darwin.txt @@ -37,6 +37,9 @@ fcntl.[A-Z0-9_]+ 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_]+ + # Loadable SQLite extensions are disabled on GitHub runners (sqlite3(.dbapi2)?.Connection.enable_load_extension)? (sqlite3(.dbapi2)?.Connection.load_extension)? diff --git a/tests/stubtest_allowlists/linux.txt b/tests/stubtest_allowlists/linux.txt index 6675d5180dc0..1052a594f061 100644 --- a/tests/stubtest_allowlists/linux.txt +++ b/tests/stubtest_allowlists/linux.txt @@ -40,6 +40,9 @@ fcntl.[A-Z0-9_]+ 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_]+ + # Loadable SQLite extensions are disabled on GitHub runners (sqlite3(.dbapi2)?.Connection.enable_load_extension)? (sqlite3(.dbapi2)?.Connection.load_extension)? diff --git a/tests/stubtest_allowlists/win32.txt b/tests/stubtest_allowlists/win32.txt index 9e7ad19d5607..1222e707a564 100644 --- a/tests/stubtest_allowlists/win32.txt +++ b/tests/stubtest_allowlists/win32.txt @@ -1,6 +1,5 @@ _msi.MSI[A-Z_]+ _msi.PID_[A-Z_]+ -_stat.FILE_ATTRIBUTE_[A-Z_]+ ctypes.GetLastError # Is actually a pointer distutils.archive_util.getgrnam distutils.archive_util.getpwnam