Message245780
Python session with 3.5b2
Showing existing error:
>>> from shutil import which
Works OK
>>> which("python")
'C:\\Python27\\python.EXE'
Also works OK
>>> which('C:\\Python27\\python.EXE')
'C:\\Python27\\python.EXE'
Fails
>>> which('C:\\Python27\\python')
>>>
Showing better results with my fix (attached):
>>> from which2 import which
>>> which("python")
'C:\\Python27\\python.exe'
>>> which('C:\\Python27\\python.exe')
'C:\\Python27\\python.exe'
>>> which('C:\\Python27\\python')
'C:\\Python27\\python.exe'
Problem is with the short-circuiting code near the beginning of the function. It fails to check the extensions for Windows when short-circuited.
My fix has a few other improvements -- efficiency and nicer output without those ugly upper-case extensions. |
|
Date |
User |
Action |
Args |
2015-06-24 22:09:39 | bobjalex | set | recipients:
+ bobjalex |
2015-06-24 22:09:39 | bobjalex | set | messageid: <1435183779.2.0.13075721906.issue24505@psf.upfronthosting.co.za> |
2015-06-24 22:09:39 | bobjalex | link | issue24505 messages |
2015-06-24 22:09:39 | bobjalex | create | |
|