[issue4198] os.path.normcase gets fooled on windows with mapped linux network drive

Merlijn van Deen report at bugs.python.org
Tue May 22 16:20:09 CEST 2012


Merlijn van Deen <valhallasw at gmail.com> added the comment:

OK, I did some quick tests. Given a samba share with the following files

A (contents: 'test: A')
a (contents: 'test: a')
B (contents: 'test: B')

1) opening \\share\files\A or \\share\files\a opens the same file - in my
case 'test: A'
2) opening \\share\files\B or \\share\files\b both work.

As such, the behaviour is at least not incorrect. In addition, it means
that the "if normcase(path1) == normcase(path2):" option to check if two
files are the same is actually correct (if normcase(path1) ==
normcase(path2) then open(path1).read() == open(path2).read() - at least on
the share I tested). Interestingly, os.path.samefile suggests this would
not be the case:

True
>>> os.path.samefile("u:\\a", "u:\\A")
False

On 22 May 2012 03:59, Ezio Melotti <report at bugs.python.org> wrote:

>
> Changes by Ezio Melotti <ezio.melotti at gmail.com>:
>
>
> ----------
> nosy: +brian.curtin, tim.golden
> stage:  -> needs patch
> versions:  -Python 3.4
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <http://bugs.python.org/issue4198>
> _______________________________________
>

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4198>
_______________________________________


More information about the Python-bugs-list mailing list