AutomatedTester / browsermob-proxy-py

A python wrapper for Browsermob Proxy
http://oss.theautomatedtester.co.uk/browsermob-proxy-py
236 stars 104 forks source link

server.start() not working on Macosx 10.8 #15

Closed guandalf closed 11 years ago

guandalf commented 11 years ago

Hi,

I'm getting this on Macosx: File "/Users/guandalf/PycharmProjects/qatools/ENV/lib/python2.7/site-packages/browsermobproxy/server.py", line 48, in start stderr=subprocess.STDOUT) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 679, in init errread, errwrite) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1228, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

The missing file is the 'sh' in the init on line 35.

Putting "/bin/sh" or "/bin/bash" fixes the "No such file or directory" but triggers: self.server.start() File "/Users/guandalf/PycharmProjects/qatools/ENV/lib/python2.7/site-packages/browsermobproxy/server.py", line 55, in start raise Exception("Can't connect to Browsermob-Proxy") Exception: Can't connect to Browsermob-Proxy

instead.

I've not investigated further.

AutomatedTester commented 11 years ago

Are you passing in the files from the bin directory as details in https://github.com/lightbody/browsermob-proxy#rest-api ?

guandalf commented 11 years ago

Ok, the problem here was that the PATH environment variable was not set correctly (at all) so the "sh" command was not found. It could be fixed putting the absolute path ("/bin/sh") but then it's the browsermob-proxy launch script to fail for the same reason, so it's probably not worth the change.

Thank you for your time.