Python Forum
p]Why os.path.exists("abc/d") and os.path.exists("abc/D") treat same - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: p]Why os.path.exists("abc/d") and os.path.exists("abc/D") treat same (/thread-27130.html)



p]Why os.path.exists("abc/d") and os.path.exists("abc/D") treat same - rajeev1729 - May-27-2020

Why os.path.exists("abc/d") and os.path.exists("abc/D") treat same but actually both are different path. Before running create abc folder and then inside abc folder create d folder to test it.
print(os.path.exists("abc/d")==os.path.exists("abc/D"))
Output it gives is true and it should be false.


RE: p]Why os.path.exists("abc/d") and os.path.exists("abc/D") treat same - DeaD_EyE - May-27-2020

I guess you're on a Windows-System where the file-system is not case-sensitive.
If you want to have False as result, you've to switch to Linux, Mac or some other *bsd like system.