[issue444582] Finding programs in PATH, adding shutil.which

2022-04-10 Thread admin
Change by admin : -- github: None -> 34832 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue444582] Finding programs in PATH, adding shutil.which

2013-03-25 Thread Éric Araujo
Éric Araujo added the comment: It’s probably too late to address Georg’s comment about reusing os.get_exec_path, so everything is done. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker

[issue444582] Finding programs in PATH, adding shutil.which

2013-03-25 Thread Thomas Kluyver
Thomas Kluyver added the comment: Yes, I opened that as issue 16957, and it has been dealt with. So no objection from me to closing this. -- ___ Python tracker ___

[issue444582] Finding programs in PATH, adding shutil.which

2013-03-25 Thread Mark Lawrence
Mark Lawrence added the comment: Was a separate issue opened? Is anything outstanding here or can this issue be closed? -- nosy: +BreamoreBoy ___ Python tracker ___ __

[issue444582] Finding programs in PATH, adding shutil.which

2013-01-13 Thread Brian Curtin
Brian Curtin added the comment: Please open a separate issue. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue444582] Finding programs in PATH, adding shutil.which

2013-01-13 Thread Thomas Kluyver
Thomas Kluyver added the comment: The 'short circuit' appears to do what I'd consider the wrong thing when an executable file of the same name exists in the working directory. i.e. which('setup.py') can return 'setup.py', even though running 'setup.py' in a shell doesn't work (you need ./setup

[issue444582] Finding programs in PATH, adding shutil.which

2012-11-06 Thread Peter Eisentraut
Changes by Peter Eisentraut : -- nosy: +petere ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 84b48551cd13 by Georg Brandl in branch 'default': #444582: fix example and rewrap docs a bit. http://hg.python.org/cpython/rev/84b48551cd13 -- ___ Python tracker ___

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I don't think the Windows example in the reST documentation is correct: >>> print(shutil.which("python")) 'c:\\python33\\python.exe' It should be either >>> shutil.which("python") 'c:\\python33\\python.exe' or >>> print(

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-24 Thread Georg Brandl
Georg Brandl added the comment: >From 3.2, os has a function get_exec_path -- shouldn't which() use it instead >of rolling its own query of $PATH? -- nosy: +georg.brandl ___ Python tracker __

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: There is another small issue: it returns the normcase'd dir, which means that the case is lost under Windows. Not very serious, but cosmetically imperfect I suppose. -- ___ Python tracker

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 9d2fe615a400 by Antoine Pitrou in branch 'default': Issue #444582: shutil.which() respects relative paths. http://hg.python.org/cpython/rev/9d2fe615a400 -- ___ Python tracker

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-22 Thread R. David Murray
R. David Murray added the comment: I'm fine with it changing. Hopefully it won't introduce subtle bugs in anyone's programs :) -- ___ Python tracker ___ _

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I think it would be more surprising if by default it did something > different than what the 'which' command does. You know, I've never noticed that Unix `which` automatically abspathified the results (does it always? is it system-dependent? how about Windows

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I just pushed the change before I saw this message, so it went in as > the patch shows. Do you want this changed? Well, I think it would be better indeed. -- ___ Python tracker

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-22 Thread R. David Murray
R. David Murray added the comment: I think it would be more surprising if by default it did something different than what the 'which' command does. It also seems like the most useful result to return by default. If there's demand for a non-abspath version we could add that as a feature late

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-22 Thread Brian Curtin
Brian Curtin added the comment: > I don't really understand why you call abspath(). If the caller wants an > absolute path, they can call abspath() themselves. Because that is what `which` does. I just pushed the change before I saw this message, so it went in as the patch shows. Do you want

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0fe7439e470c by Brian Curtin in branch 'default': Fix #444582. Add shutil.which function for finding programs on the system path. http://hg.python.org/cpython/rev/0fe7439e470c -- nosy: +python-dev ___ Py

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't really understand why you call abspath(). If the caller wants an absolute path, they can call abspath() themselves. -- ___ Python tracker ___

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-22 Thread Brian Curtin
Brian Curtin added the comment: I don't know. It makes sense to me. I'll try to find someone else to look at it and adjust it. -- ___ Python tracker ___ __

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-22 Thread R. David Murray
R. David Murray added the comment: I'm fine with this version going in, but I don't understand what you are saying about PATHEXT. You are getting it from the environment, but you say the shell always looks at the extension. So if someone has changed PATHEXT in their environment, Windows ign

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-22 Thread Brian Curtin
Brian Curtin added the comment: Attached is a patch which fixes your review comments in Lib/shutil.py, and it makes an adjustment in the wording of the documentation. The documentation is a bit more strong in wording that the current directory is always prepended to the path whether its a pro

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-22 Thread R. David Murray
R. David Murray added the comment: Added some review comments on latest patch. -- ___ Python tracker ___ ___ Python-bugs-list mailin

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-21 Thread Brian Curtin
Brian Curtin added the comment: Here's a patch that also works on linux. A pathext specific test is now skipped since that only matters on Windows, and I forgot a chmod that was making two tests fail on linux. -- Added file: http://bugs.python.org/file26078/issue444582_v3.diff __

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-19 Thread Brian Curtin
Brian Curtin added the comment: > I don't think file is a good name. Changed to "cmd" for command, and that's what the Unix `which` calls it as well. > Wait, why are we even returning more than one result? I don't see any use > cases for that in the issue (though I admit I just skimmed it).

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-19 Thread R. David Murray
R. David Murray added the comment: I'm not sure why there isn't a review link for your patch. "which(file..." I don't think file is a good name. 'fn' or 'filename' or 'string' would all be better choices, I think. 'file' implies a Python file object (to me). And "the give *file* command i

[issue444582] Finding programs in PATH, adding shutil.which

2012-06-19 Thread Brian Curtin
Brian Curtin added the comment: Before we miss yet another beta freeze, how does something like this look? It moves `which` into one function which always yields paths. I don't think anyone will approve of adding a dual-function API to solve this problem. I originally tried an approach where

[issue444582] Finding programs in PATH, adding shutil.which

2012-02-04 Thread Omega Weapon
Changes by Omega Weapon : -- nosy: +Omega_Weapon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue444582] Finding programs in PATH, adding shutil.which

2011-11-28 Thread Weeble
Weeble added the comment: I'm not sure what rules are used by Windows to process the PATH string, but I think they are similar to the rules used to parse the command-line into argv in a C/C++ program: http://msdn.microsoft.com/en-us/library/17w5ykft.aspx I have tested various arrangements of

[issue444582] Finding programs in PATH, adding shutil.which

2011-11-08 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue444582] Finding programs in PATH, adding shutil.which

2011-08-08 Thread Simon Law
Changes by Simon Law : -- nosy: +sfllaw ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org

[issue444582] Finding programs in PATH, adding shutil.which

2011-07-15 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue444582] Finding programs in PATH, adding shutil.which

2011-04-23 Thread Éric Araujo
Éric Araujo added the comment: Can someone remove obsolete files from the file list and post an up-to-date patch? -- keywords: -easy ___ Python tracker ___ __

[issue444582] Finding programs in PATH, adding shutil.which

2011-01-03 Thread Jan Killian
Jan Killian added the comment: Hello All, sorry for lack of communication recently, I'd alos like to see it in 3.2 instead of 3.3, but my time is not as scalable as I wish and I can't run on clouds yet .) I like Trent's module and especially its usefullness via the commandline. I'm also hap

[issue444582] Finding programs in PATH, adding shutil.which

2011-01-03 Thread Éric Araujo
Éric Araujo added the comment: Sandro: I merely did some bug triage here. I will let interested parties come to an agreement, and Tarek will make the decisions on this request. -- ___ Python tracker ___

[issue444582] Finding programs in PATH, adding shutil.which

2011-01-03 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- resolution: accepted -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue444582] Finding programs in PATH, adding shutil.which

2011-01-03 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- versions: +Python 3.3 -Python 3.2 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue444582] Finding programs in PATH, adding shutil.which

2011-01-01 Thread Sandro Tosi
Sandro Tosi added the comment: Hi Jan, are you still going to work on this feature? Hi Éric, what are we going to do: include Jan's patch when ready or Trent's `which` tool on google code? Cheers, Sandro -- nosy: +sandro.tosi ___ Python tracker <

[issue444582] Finding programs in PATH, adding shutil.which

2010-11-17 Thread Éric Araujo
Éric Araujo added the comment: Adding people from the duplicate bug to nosy. Alternate implementation, which looks more thorough: http://code.google.com/p/which/ (from Trent Mick, added to nosy, who’s already agreed to contribute his code). -- dependencies: -replace dist/src/Tools/s

[issue444582] Finding programs in PATH, adding shutil.which

2010-11-17 Thread Éric Araujo
Éric Araujo added the comment: Hello Jan. Can you give us a status update on this one? Iztok: There is a lot of code out there, written in anything from Python to awk to shell, that splits on “:”. Perhaps it’s okay to just not support “:” in directory names. -- ___

[issue444582] Finding programs in PATH, adding shutil.which

2010-08-26 Thread R. David Murray
R. David Murray added the comment: As far as I can tell from a little bit of testing, if it is even possible to quote ':' in a posix path it isn't obvious how you do it. -- nosy: +r.david.murray ___ Python tracker

[issue444582] Finding programs in PATH, adding shutil.which

2010-08-15 Thread Iztok Kavkler
Iztok Kavkler added the comment: There is a subtle problem in the reference implementation: it will break if one of the paths in PATH contains quoted path separator. On windows that would be quted with ": "c:\path;with;sep" and on *nix something like /path\:with\:sep The problem is in the

[issue444582] Finding programs in PATH, adding shutil.which

2010-08-08 Thread Jan Killian
Jan Killian added the comment: Hi Tarek Will do that on Tusdas. Examples make sense too Jan On Sun, Aug 8, 2010 at 11:15 AM, Tarek Ziadé wrote: > > Tarek Ziadé added the comment: > > looks good, minor changes before I commit it > > can you: > > - remove all old patches in this issue > - mak

[issue444582] Finding programs in PATH, adding shutil.which

2010-08-08 Thread Tarek Ziadé
Tarek Ziadé added the comment: looks good, minor changes before I commit it can you: - remove all old patches in this issue - make your code pep8 - rename the 'file' argument to 'filename' - add yourself in ACKS one or two usage examples in the Doc would be a nice plus thx --

[issue444582] Finding programs in PATH, adding shutil.which

2010-07-14 Thread Jan Killian
Changes by Jan Killian : Added file: http://bugs.python.org/file18001/which.py ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue444582] Finding programs in PATH, adding shutil.which

2010-07-14 Thread Jan Killian
Jan Killian added the comment: * updated tests -- Added file: http://bugs.python.org/file18000/shutil_which_82778.patch ___ Python tracker ___ _

[issue444582] Finding programs in PATH, adding shutil.which

2010-07-12 Thread Jan Killian
Changes by Jan Killian : Added file: http://bugs.python.org/file17963/which.py ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue444582] Finding programs in PATH, adding shutil.which

2010-07-12 Thread Jan Killian
Jan Killian added the comment: @ Éric and Antoine: Thanks for the useful hints! * PATH and PATHEXT are now evaluated when needed, not only on module init. The rationale is, that the lib user may change them, eg. to include a directory with additional commands. * the only helper module-level

[issue444582] Finding programs in PATH, adding shutil.which

2010-07-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Some comments on the patch: - shouldn't getdir_id use os.path.normcase() rather than manually switch on `windows`? - the patch adds lots of names at the top-level which aren't part of the public API ("windows", "getdir_id", "defpath", "defpath_ext"). They shou

[issue444582] Finding programs in PATH, adding shutil.which

2010-07-12 Thread Éric Araujo
Éric Araujo added the comment: Jan, new features don’t go in stable releases. Your patch targets 3.2 (see the versions field at the top of the page). -- ___ Python tracker ___

[issue444582] Finding programs in PATH, adding shutil.which

2010-07-11 Thread Jan Killian
Changes by Jan Killian : Added file: http://bugs.python.org/file17958/which.py ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue444582] Finding programs in PATH, adding shutil.which

2010-07-11 Thread Jan Killian
Changes by Jan Killian : Removed file: http://bugs.python.org/file17947/shutil_which_82778.patch ___ Python tracker ___ ___ Python-bugs-list

[issue444582] Finding programs in PATH, adding shutil.which

2010-07-11 Thread Jan Killian
Jan Killian added the comment: * updated docs in the patch @ Éric: Thanks, that works nicely :) @ Michael: You don't need cygwin to use which and many gnu tools on windows. See http://gnuwin32.sourceforge.net/packages.html. After installation you can take the ,exe and .dll files in GnuWin32/

[issue444582] Finding programs in PATH, adding shutil.which

2010-07-11 Thread Jan Killian
Changes by Jan Killian : Removed file: http://bugs.python.org/file17948/which.py ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

[issue444582] Finding programs in PATH, adding shutil.which

2010-07-11 Thread Éric Araujo
Éric Araujo added the comment: Jan, have you tried this: $ ./python -m test.test_shutil This uninstalled Python will import the shutil module from the checkout. -- ___ Python tracker

[issue444582] Finding programs in PATH, adding shutil.which

2010-07-11 Thread Michael Foord
Michael Foord added the comment: which is useful for discovering *if* a program is available (I sorely miss it on Windows when I don't have cygwin installed). +1 for adding it to shutil. -- nosy: +michael.foord ___ Python tracker

[issue444582] Finding programs in PATH, adding shutil.which

2010-07-11 Thread Jan Killian
Changes by Jan Killian : Added file: http://bugs.python.org/file17948/which.py ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue444582] Finding programs in PATH, adding shutil.which

2010-07-11 Thread Jan Killian
Jan Killian added the comment: * hardcoded deafult PATHEXT values for different versions of Windows (confirmed the W2K, W2008 values via google) * code+tests+docs cleanup Just one question: is there some std proc how to run the test suite on the updated stdlib in a working repo? For now, I j

[issue444582] Finding programs in PATH, adding shutil.which

2010-07-09 Thread Jan Killian
Jan Killian added the comment: @tarek: Sorry for not reacting, it completely vaporized out of my head. I'll do the patch this weekend. Agree, only which/which_files belong to public API. Regarding PATHEXT: 1. When a new process is created, the value is taken from registry variable PATHEXT

[issue444582] Finding programs in PATH, adding shutil.which

2010-07-08 Thread Éric Araujo
Changes by Éric Araujo : -- resolution: -> accepted title: Finding programs in PATH, addition to os -> Finding programs in PATH, adding shutil.which versions: +Python 3.2 -Python 2.7, Python 3.1 ___ Python tracker