Author CrouZ
Recipients CrouZ, paul.moore, steve.dower, tim.golden, zach.ware
Date 2019-11-16.18:14:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
After upgrading some scripts from Python 2.7 to 3.7 in Windows 10, I got different behavior that seems to be caused by inconsistent behavior for os.stat in Python 3.7.

Python 2.7:
>>> os.stat("D:\\System Volume Information")
nt.stat_result ...
>>> os.stat("D:\\System Volume Information\\")
nt.stat_result ... (same as previous call)

Python 3.7:
>>> os.stat("D:\\System Volume Information")
os.stat_result ...
>>> os.stat("D:\\System Volume Information\\")
Traceback ...
PermissionError: [WinError 5] Access is denied: 'D:\\System Volume Information\\'

What I really do is calling:
>>> os.path.exists("D:\\System Volume Information\\")
False (Unexpected and inconsistent. I expect the return value to be True.)

Behavior for other calls:
>>> os.path.exists("D:\\System Volume Information")
True (OK)
>>> os.path.isdir("D:\\System Volume Information\\")
True (OK, but according to the documentation "Return True if path is an existing directory." where 'existing' links to os.path.exists, which returns False)

The closest issue I could find was Issue28075 which has already been fixed.
Date User Action Args
2019-11-16 18:14:54CrouZsetrecipients: + CrouZ, paul.moore, tim.golden, zach.ware, steve.dower
2019-11-16 18:14:54CrouZsetmessageid: <>
2019-11-16 18:14:54CrouZlinkissue38822 messages
2019-11-16 18:14:54CrouZcreate