[issue36112] os.path.realpath on windows and substed drives

Totte Karlsson report at bugs.python.org
Mon Feb 25 18:21:50 EST 2019


New submission from Totte Karlsson <tottek at gmail.com>:

Python's os.path.realpath, when used with a substed drive on the Windows platform, don't resolve the substed path to the *real* path. 

For example creating a substed drive like this:

    subst z: C:\Users\Public\Desktop

and checking for the real path in python like this:

    import os
    myPath = "S:\\"
    print("Real path of: " + myPath + " is: " + os.path.realpath(myPath) )

prints

    Real path of: S:\ is: S:\

In the docs for the [subst][1] command, a substed drive is referred to as a *virtual* drive. Virtual, suggesting something being "not real", indicates that the Python *realpath* command is not working properly on Windows. 


  [1]: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/subst

----------
components: Windows
messages: 336574
nosy: Totte Karlsson, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: os.path.realpath on windows and substed drives
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36112>
_______________________________________


More information about the Python-bugs-list mailing list