Closed lengau closed 1 month ago
Describe the bug Windows reserved paths are not reported as reserved in PureWindowsPath with Python 3.12+
PureWindowsPath
How To Reproduce
import pathlib import pyfakefs import pytest WINDOWS_RESERVED_NAMES = ( "CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9", ) @pytest.mark.parametrize( "reserved_name", WINDOWS_RESERVED_NAMES ) def test_real_fs_com1(reserved_name): assert not pathlib.PurePosixPath(reserved_name).is_reserved() assert not pathlib.PurePosixPath(reserved_name + ".txt").is_reserved() @pytest.mark.parametrize( "reserved_name", WINDOWS_RESERVED_NAMES ) def test_fake_fs_com1(fs, reserved_name): assert not pathlib.PurePosixPath(reserved_name).is_reserved() assert not pathlib.PurePosixPath(reserved_name + ".txt").is_reserved()
Your environment
Linux-6.11.0-8-generic-x86_64-with-glibc2.40 Python 3.11.10 (main, Sep 9 2024, 22:11:19) [Clang 18.1.8 ] pyfakefs 5.7.dev0 pytest 8.3.3
Describe the bug Windows reserved paths are not reported as reserved in
PureWindowsPath
with Python 3.12+How To Reproduce
Your environment