[tahoe-dev] How to track after subprocess.call()?

Steven Lee elderry at outlook.com
Thu Jul 18 11:07:33 UTC 2013


I have solved this problem, details in http://stackoverflow.com/questions/17721226/how-to-debug-into-subprocess-call-in-python. So don't waste time anymore, thanks anyway.

From: elderry at outlook.com
To: tahoe-dev at tahoe-lafs.org
Subject: How to track after subprocess.call()?
Date: Thu, 18 Jul 2013 17:30:53 +0800




I am trying to understand Tahoe's source code these days, I built it under Arch Linux with Eclipse and PyDev, then set a test grid, everything works well. Then I'd like to execute this command:tahoe -d . cp e1 tahoe:I have tested this command in Terminal and it run well, so I entered the Debug mode in Eclipse and try to follow it line by line, however, when it comes to line 119 of $BASE/bin/tahoe:res = subprocess.call(command, env=os.environ)I checked the variable "command" and realized that this function just throw my command above to script: $BASE/support/bin/tahoe and try to execute it in a subprocess. So I jumped out of Eclipse, and tried to execute the command through Terminal while under the same directory:$BASE/support/bin/tahoe -d . cp e1 tahoe:
Now this is what I got:Traceback (most recent call last):  File "/home/elderry/Projects/git/tahoe-lafs/support/bin/tahoe", line 6, in <module>    from pkg_resources import load_entry_point  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2850, in <module>    working_set.require(__requires__)  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 696, in require    needed = self.resolve(parse_requirements(requirements))  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 594, in resolve    raise DistributionNotFound(req)pkg_resources.DistributionNotFound: allmydata-tahoe==1.10.0.post27
Then I completely lost my direction, where does the subprocess continue to run? I viewed $BASE/support/bin/tahoe and found it's so short, which confused me more. With some hope I set some break points in it in Eclipse, which didn't catch anything.
Anyone can help? Thanks anyway. 		 	   		   		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tahoe-lafs.org/pipermail/tahoe-dev/attachments/20130718/dfc14c8c/attachment.html>


More information about the tahoe-dev mailing list