Skip to content

Commit 8a7e4e7

Browse files
committed
gh-152691: Document Windows reserved names in tarfile guidance
1 parent f1c5363 commit 8a7e4e7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Doc/library/tarfile.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,10 @@ Here is an incomplete list of things to consider:
11951195
* Check filenames against an allow-list of characters
11961196
(to filter out control characters, confusables, foreign path separators,
11971197
and so on).
1198+
* Check for platform-specific filename semantics. For example, on Windows
1199+
some names can refer to NTFS alternate data streams rather than ordinary
1200+
files, or have other reserved meanings. Use :func:`os.path.isreserved`
1201+
where appropriate to detect reserved pathnames.
11981202
* Check that filenames have expected extensions (discouraging files that
11991203
execute when you “click on them”, or extension-less files like Windows
12001204
special device names).

0 commit comments

Comments
 (0)