[issue444582] Finding programs in PATH, addition to os

2010-07-08 Thread Éric Araujo
Éric Araujo added the comment: I apologize for not reading the first post more carefully, thank you for restating the use cases. I’m +1 now and I’ll review the patches to make it up :) Bugs may take years to get fixed. Now that Tarek has expressed interest, be sure that this won’t get lost agai

[issue444582] Finding programs in PATH, addition to os

2010-07-08 Thread Erik Demaine
Erik Demaine added the comment: As mentioned in the original request, there are at least two motivations for "which" functionality that are distinct from running the program (these days, with the subprocess module). #1 was detecting existence of a program. #2 was finding the *second* instan

[issue444582] Finding programs in PATH, addition to os

2010-07-08 Thread Andy Buckley
Andy Buckley added the comment: Personally I think it's a very useful feature: the purpose for running which may not be to get the full path to the executable and then run it, but rather that that path prefix is important for something else. I'm sure when I joined this issue I had some need l

[issue444582] Finding programs in PATH, addition to os

2010-07-04 Thread Éric Araujo
Éric Araujo added the comment: Is a “which” function that useful, since we have os.exec* functions that search the PATH for us? It seems to me that wanting to know the exact path of an executable is a specialized need, and that adding this function would make beginners use it instead of the o

[issue444582] Finding programs in PATH, addition to os

2010-05-19 Thread Dan Buch
Changes by Dan Buch : -- nosy: +meatballhat ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue444582] Finding programs in PATH, addition to os

2010-05-19 Thread Tarek Ziadé
Tarek Ziadé added the comment: @iki: could you refactor your code so it's in shutil (and the tests in test_shutil) few remarks: only which/which_files should be public API, Next, I don't think extensions like VBS should be hardcoded if PATHEXT is not found. A pseudo-dos shell just runs .exe

[issue444582] Finding programs in PATH, addition to os

2010-05-19 Thread Tarek Ziadé
Tarek Ziadé added the comment: SOunds like a good feature to add in shutil, I'll check the patch and also compare it to distutils.spawn.find_executable() -- ___ Python tracker ___

[issue444582] Finding programs in PATH, addition to os

2010-05-19 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- assignee: -> tarek nosy: +tarek ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue444582] Finding programs in PATH, addition to os

2010-05-19 Thread Christophe Simonis
Changes by Christophe Simonis : -- nosy: +Christophe Simonis ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

[issue444582] Finding programs in PATH, addition to os

2010-03-05 Thread Jan Killian
Jan Killian added the comment: Updated version of reference implementation as a standalone module * changed interface: which_files() returns generator, which() returns first match, or raises IOError(errno.ENOENT) * updated doctest Made this to more closely resemble the 'which' co

[issue444582] Finding programs in PATH, addition to os

2010-03-04 Thread Jan Killian
Jan Killian added the comment: Adapted Brian Curtin's http://bugs.python.org/file15381/ shutil_which.patch and made another reference implementation as a standalone module including the following fixes: * uses ``PATHEXT`` on Windows * searches current directory before ``PATH`` on Windows, but

[issue444582] Finding programs in PATH, addition to os

2010-01-12 Thread Brian Curtin
Changes by Brian Curtin : -- stage: test needed -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue444582] Finding programs in PATH, addition to os

2009-11-22 Thread Brian Curtin
Brian Curtin added the comment: Here is a patch against r76432 which implements a "which" generator function in shutil that yields full file paths where the searched file exists on the PATH. Includes doc change and a test. It is pretty similar to what edemaine had suggested. This could just as

[issue444582] Finding programs in PATH, addition to os

2009-11-19 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: -brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue444582] Finding programs in PATH, addition to os

2009-11-19 Thread Andy Buckley
Changes by Andy Buckley : -- nosy: +andybuckley ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue444582] Finding programs in PATH, addition to os

2009-04-22 Thread Daniel Diniz
Changes by Daniel Diniz : -- dependencies: +replace dist/src/Tools/scripts/which.py with tmick's which keywords: +easy ___ Python tracker ___ ___

[issue444582] Finding programs in PATH, addition to os

2009-03-15 Thread Skip Montanaro
Changes by Skip Montanaro : -- nosy: -skip.montanaro ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue444582] Finding programs in PATH, addition to os

2009-03-11 Thread Tennessee Leeuwenburg
Tennessee Leeuwenburg added the comment: +1 adding which to shutil -- nosy: +tleeuwenb...@gmail.com ___ Python tracker ___ ___ Pytho

[issue444582] Finding programs in PATH, addition to os

2009-02-12 Thread Daniel Diniz
Changes by Daniel Diniz : -- components: +Library (Lib) -None nosy: +ajaksu2 stage: -> test needed versions: +Python 2.7, Python 3.1 -Python 2.6, Python 3.0 ___ Python tracker

[issue444582] Finding programs in PATH, addition to os

2007-11-23 Thread Christian Heimes
Christian Heimes added the comment: I'm +1 with adding a which function. IMO the appropriate place is shutil and not os. -- keywords: +patch nosy: +tiran versions: +Python 2.6, Python 3.0 Tracker <[EMAIL PROTECTED]>

[issue444582] Finding programs in PATH, addition to os

2007-08-28 Thread Skip Montanaro
Skip Montanaro added the comment: Commenting on Brett's reply... We use this sort of facility in SpamBayes to search for the OCR program. I crafted something by hand which didn't work on Windows. Mark Hammond had to clean up the mess I made. Having this as a canned function in os would be han