[issue22719] os.path.isfile & os.path.exists bug in while loop

R. David Murray report at bugs.python.org
Fri Oct 24 18:34:09 CEST 2014


R. David Murray added the comment:

Interesting bug.  The obvious difference between the two cases is that in the += version the address of the string pointing to the filepath doesn't change, whereas when you use a temp variable it does (there's an optimization in += that reuses the same memory location if possible).  It looks like something is seeing that repeated addresses and returning the same result as the last time that address was passed, which is wrong.

I don't see anything obvious in os module.  Although I can't rule out a Python bug, since this works fine on unix I suspect this is a Windows CRT bug.

----------
nosy: +r.david.murray

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


More information about the Python-bugs-list mailing list