Does This Scare You?
Chris Angelico
rosuav at gmail.com
Fri Aug 19 20:57:37 EDT 2016
On Sat, Aug 20, 2016 at 9:42 AM, Lawrence D’Oliveiro
<lawrencedo99 at gmail.com> wrote:
> Python 3.5.2+ (default, Aug 5 2016, 08:07:14)
> [GCC 6.1.1 20160724] on linux
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from pathlib import PureWindowsPath
> >>> PureWindowsPath("prn").is_reserved()
> True
> >>> PureWindowsPath("prn.doc").is_reserved()
> True
> >>> PureWindowsPath("com9.exe").is_reserved()
> True
> >>> PureWindowsPath("c:/my documents/prn.doc").is_reserved()
> True
When was the last time you wanted to create a file with a reserved
name? Paths, drive letters, file extensions, don't matter. All that
matters is the base name.
Not a Python issue; they're reserved by Windows.
ChrisA
More information about the Python-list
mailing list