[issue37993] os.path.realpath on Windows resolves mapped network drives

Steve Dower report at bugs.python.org
Wed Sep 11 05:38:49 EDT 2019


Steve Dower <steve.dower at python.org> added the comment:

I'm closing this as not a bug.

It's a few steps deep, but DefineDosDeviceW() [1] specifies that it creates junctions, and while it's not necessarily obvious how to get from SUBST to that page, Wikipedia managed it [2]. And I don't think it's unreasonable to expect people to either think about this really shallowly ("realpath will find the real path") or really deeply ("let me research every aspect to find the true answer") and avoid over-specifying the behaviour in our own documentation.

"MS-DOS device names are stored as junctions in the object namespace. The code that converts an MS-DOS path into a corresponding path uses these junctions to map MS-DOS devices and drive letters. The DefineDosDevice function enables an application to modify the junctions used to implement the MS-DOS device namespace."

[1]: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-definedosdevicew
[2]: https://en.wikipedia.org/wiki/SUBST

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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


More information about the Python-bugs-list mailing list