[issue40592] `Shutil.which` incosistent with windows's `where`

2020-10-23 Thread miss-islington


miss-islington  added the comment:


New changeset c437fe39cf5318f27f3381a983fbf320f65064bc by Miss Skeleton (bot) 
in branch '3.9':
[3.9] bpo-40592: shutil.which will not return None anymore if ; is the last 
char in PATHEXT (GH-20088) (GH-22912)
https://github.com/python/cpython/commit/c437fe39cf5318f27f3381a983fbf320f65064bc


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-10-23 Thread miss-islington


miss-islington  added the comment:


New changeset 8b4842b7a830299870067bba59f53529b13647a2 by Miss Skeleton (bot) 
in branch '3.8':
[3.8] bpo-40592: shutil.which will not return None anymore if ; is the last 
char in PATHEXT (GH-20088) (GH-22913)
https://github.com/python/cpython/commit/8b4842b7a830299870067bba59f53529b13647a2


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-10-23 Thread Steve Dower


Steve Dower  added the comment:

Thanks for the contribution! Looking forward to your next one :)

--
nosy:  -miss-islington
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-10-23 Thread Steve Dower


Steve Dower  added the comment:


New changeset da6f098188c9825f10ae60db8987056b3a54c2e8 by Christopher 
Marchfelder in branch 'master':
bpo-40592: shutil.which will not return None anymore if ; is the last char in 
PATHEXT (GH-20088)
https://github.com/python/cpython/commit/da6f098188c9825f10ae60db8987056b3a54c2e8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-10-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21844
pull_request: https://github.com/python/cpython/pull/22913

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-10-23 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +21843
pull_request: https://github.com/python/cpython/pull/22912

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-10-22 Thread Christopher Marchfelder


Christopher Marchfelder  added the comment:

@steve.dower Your advice did it, is fixed and green! :) Thank you again

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-10-21 Thread Christopher Marchfelder


Christopher Marchfelder  added the comment:

@steve.dower Added the changes in the PR - could you please re-check? Thank you!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-05-14 Thread Christopher Marchfelder


Change by Christopher Marchfelder :


--
keywords: +patch
pull_requests: +19392
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/20088

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-05-14 Thread Christopher Marchfelder


Christopher Marchfelder  added the comment:

@steve.dower I would really love to work on this and make my first 
contribution. Never did one, so I would some help doing this one :)

--
nosy: +Christopher Marchfelder

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-05-12 Thread Steve Dower


Steve Dower  added the comment:

Sounds like a good opportunity for someone to make their first contribution.

Post a message if you'd like to work on this (and a test), and we can help get 
through the PR process.

--
keywords: +easy, newcomer friendly

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-05-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40592] `Shutil.which` incosistent with windows's `where`

2020-05-11 Thread Dawid Gosławski

New submission from Dawid Gosławski :

Shutil's which implementation does not work correctly when someone set's empty 
item in `PATHEXT` environment variable. Example:

set PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.RB;.RBW;

I'm not 100% sure how I got this in my PATHEXT config, I wasn't changing that 
so maybe some bugged uninstaller not removed it's extension correctly.

This makes things confusing as Windows will find correctly binary, but Python 
will return nothing, due to this part:

```
if any(cmd.lower().endswith(ext.lower()) for ext in pathext):
files = [cmd]
```

pathext is initialized as `pathext = os.environ.get("PATHEXT", 
"").split(os.pathsep)`, which ends producing '' as last element

Because any string ends with empty string (''), files list will have plain 
version added like `git`, which will then fail executable check.

Workaround is to use full name `git.exe`

Filtering out empty strings would fix that.

--
components: Library (Lib)
messages: 368620
nosy: alkuzad
priority: normal
severity: normal
status: open
title: `Shutil.which` incosistent with windows's `where`

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com