Martin Panter added the comment: I agree with Josh. This is how it is supposed to work.
os.system calls the shell (e.g. Bash) rather than running the "ls" program directly. Unix shells translate "~" to the home directory (as well as translating a lot of other stuff, e.g. spaces to separate CLI arguments). But if you pass "~" to os.path.exists (or most other functions), that goes directly to the operating system and looks for a directory literally called "~". If you created a directory with that name, it should return True then. ---------- nosy: +martin.panter resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29831> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com