GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Path.chmod() silently fails on Windows when archive bit is cleared and follow_symlinks=True · Issue #140774 · python/cpython Open Labels OS-windowsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportBug description:Expected behavior:
Actual behavior:
import os import stat import subprocess from pathlib import Path def is_read_only(file: str | os.PathLike) -> bool: return os.stat(file).st_file_attributes & stat.FILE_ATTRIBUTE_READONLY > 0 test_file = Path('test.txt') test_file.touch() subprocess.run(f'attrib -a +r {test_file}', check=True) print(f'Initial (no archive): Read Only: {is_read_only(test_file)}') test_file.chmod(stat.S_IWRITE | stat.S_IREAD) print(f'After chmod(follow_symlinks=True): Read Only: {is_read_only(test_file)}') test_file.chmod(stat.S_IWRITE | stat.S_IREAD, follow_symlinks=False) print(f'After chmod(follow_symlinks=False): {is_read_only(test_file)}') subprocess.run(f'attrib +a +r {test_file}', check=True) print(f'Initial (archive): Read Only: {is_read_only(test_file)}') test_file.chmod(stat.S_IWRITE | stat.S_IREAD) print(f'After chmod(follow_symlinks=True): Read Only: {is_read_only(test_file)}') test_file.chmod(stat.S_IWRITE | stat.S_IREAD, follow_symlinks=False) print(f'After chmod(follow_symlinks=False): {is_read_only(test_file)}') Output CPython versions tested on:3.14 Operating systems tested on:Windows Linked PRsActivity
MetadataMetadataAssigneesLabelsOS-windowsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |