Closed Chubab closed 9 years ago
My Chromium development machine has two python related directories in the path:
C:\python_27_amd64\files c:\src\depot_tools
The first one contains python.exe. I'm not sure how that directory got added to my path. Its placement in the path environment variable strongly suggests that I did not add it manually.
I checked on another Chromium developer's machine and they had the exact same paths, on a machine that was set up last week, and they were certain that they did not manually add the paths.
So, perhaps your setup is non-standard? Or perhaps its worth adding the Python directory to your path.
I think if one explicitly installs python on Windows via its installer, it may automatically add it to PATH.
I didn't explicitly install python because I just use depot_tools'; is there any way we can make UIForETW fallback to using python.bat if in path?
On Tue, Sep 1, 2015 at 4:27 PM Bruce Dawson notifications@github.com wrote:
My Chromium development machine has two python related directories in the path:
C:\python_27_amd64\files c:\src\depot_tools
The first one contains python.exe. I'm not sure how that directory got added to my path. Its placement in the path environment variable strongly suggests that I did not add it manually.
I checked on another Chromium developer's machine and they had the exact same paths, on a machine that was set up last week, and they were certain that they did not manually add the paths.
So, perhaps your setup is non-standard? Or perhaps its worth adding the Python directory to your path.
— Reply to this email directly or view it on GitHub https://github.com/google/UIforETW/issues/53#issuecomment-136851978.
I'm sure we can do something. UIforETW could parse python.bat (just the depot_tools version) and use it to locate python.exe - should be easy enough.
It's just weird that your install doesn't have python in the path. Probably they changed it in the last year to add python.exe to the path - just a guess.
I actually just re-did my setup for Win10 (although I didn't have to reinstall depot_tools per se as it was on D: and stayed around despite flashing the OS).
Don't see how I would end up with python in my path without installing it anyways though?
On Wed, Sep 2, 2015 at 1:26 PM Bruce Dawson notifications@github.com wrote:
I'm sure we can do something. UIforETW could parse python.bat (just the depot_tools version) and use it to locate python.exe - should be easy enough.
It's just weird that your install doesn't have python in the path. Probably they changed it in the last year to add python.exe to the path - just a guess.
— Reply to this email directly or view it on GitHub https://github.com/google/UIforETW/issues/53#issuecomment-137179099.
I never installed Python - I assumed that the depot_tools setup process did, somehow, but I'm not sure how/when.
How's this?
https://github.com/google/UIforETW/commit/c7891955a0cf5ef77f62c3c37245f097126c9daf
It's somewhat hardcoded - it expects to find a particular syntax to invoke python.exe - but I'm not sure I can make it more generic without knowing what variations of python.bat exist.
I'll probably reduce the indentation level before committing to master, but the nested if statements made testing easier. It does work.
I guess that works, thanks (though I'd think this should be a fallback if python.exe is not found rather than being first).
Or could you have done a simple search for python.bat the same way you look for python.exe and invoke python.bat directly (I.e., why is an exe required?)
Le jeu. 3 sept. 2015 01:17, Bruce Dawson notifications@github.com a écrit :
How's this?
c789195 https://github.com/google/UIforETW/commit/c7891955a0cf5ef77f62c3c37245f097126c9daf
It's somewhat hardcoded - it expects to find a particular syntax to invoke python.exe - but I'm not sure I can make it more generic without knowing what variations of python.bat exist.
I'll probably reduce the indentation level before committing to master, but the nested if statements made testing easier. It does work.
— Reply to this email directly or view it on GitHub https://github.com/google/UIforETW/issues/53#issuecomment-137334503.
I was definitely going to look for python.exe first. For some reason I hadn't considered launching python.bat directly. I guess I'd have to launch cmd.exe /c python.bat or something like that - I'm not sure, but I doubt python.bat can be launched directly. Thanks for the feedback.
Or just ShellExecute the path which apparently works with either .exe or .bat? (ref.
which is ironically titled the opposite of a working solution with shellexecute :-)).
On Thu, Sep 3, 2015 at 10:55 AM Bruce Dawson notifications@github.com wrote:
I was definitely going to look for python.exe first. For some reason I hadn't considered launching python.bat directly. I guess I'd have to launch cmd.exe /c python.bat or something like that - I'm not sure, but I doubt python.bat can be launched directly. Thanks for the feedback.
— Reply to this email directly or view it on GitHub https://github.com/google/UIforETW/issues/53#issuecomment-137476021.
I have to capture the output which I don't think ShellExecute supports, because the whole point is to put the output in the trace information window.
I guess I could ShellExecute "python.bat IdentifyChromeProcesses.py >%temp%\identify_output.txt" or something like that. Hmmm - too many possibilities.
Huh. It was way easier than expected. Apparently CreateProcess just works with python.bat. The issue is resolved by this change:
https://github.com/google/UIforETW/commit/36dff98cdf1dfa18327fd9253972d94e5f167100
I have not yet created a release but the next release will have the change.
Nice :-), thanks!
On Sat, Sep 5, 2015 at 7:03 PM Bruce Dawson notifications@github.com wrote:
Huh. It was way easier than expected. Apparently CreateProcess just works with python.bat. The issue is resolved by this change:
36dff98 https://github.com/google/UIforETW/commit/36dff98cdf1dfa18327fd9253972d94e5f167100
I have not yet created a release but the next release will have the change.
— Reply to this email directly or view it on GitHub https://github.com/google/UIforETW/issues/53#issuecomment-138006101.
The v 1.17 release has this change.
While saving traces to disk I get:
"Preprocessing trace to identify Chrome processes... Couldn't find python."
I have python, but like most Chrome Windows developers, it's depot_tools' which actually means I have python.bat (not python.exe itself) in my PATH.
Cheers, Gab