Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a list of directories for the "path" argument #3

Closed
pfmoore opened this issue Sep 24, 2024 · 5 comments · Fixed by #4
Closed

Allow a list of directories for the "path" argument #3

pfmoore opened this issue Sep 24, 2024 · 5 comments · Fixed by #4

Comments

@pfmoore
Copy link

pfmoore commented Sep 24, 2024

The "path" argument to the various functions is a string - I assume it has the same format as the PATH environment variable (os.pathsep separated directories to search). It might be useful to also allow a list of strings for cases where the set of paths to search is constructed programmatically.

Note: I've only just looked at this library for the first time - while I can imagine places I'd find this useful, I don't actually have a use case for this right now, so this is very much just a suggestion.

@ofek
Copy link
Owner

ofek commented Sep 24, 2024

Good idea, thanks! I chose to add a new parameter for a better user experience e.g. passing a list would be odd for a parameter name that is not plural.

@ofek ofek closed this as completed in #4 Sep 24, 2024
@ofek
Copy link
Owner

ofek commented Sep 24, 2024

@pfmoore
Copy link
Author

pfmoore commented Sep 24, 2024

Nice! And while I have your attention, I noticed that _get_executable_extensions would fail if $env:PATHEXT contained lowercase items. It would be more robust to have

EXECUTABLE_EXTENSIONS = tuple(ext.upper() for ext in pathext.split(os.pathsep) if ext)

@ofek
Copy link
Owner

ofek commented Sep 24, 2024

Thanks! Fixing #5

@ofek
Copy link
Owner

ofek commented Sep 24, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants