Parallel Python
Parallel Python Community Forums rss  
September 02, 2014, 02:13:17 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Parallel python forum is up and running!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: subprocess  (Read 3836 times)
0 Members and 1 Guest are viewing this topic.
afaulconbridge
Full Python
***

Karma: 1
Posts: 16


View Profile
« on: August 22, 2011, 04:28:33 AM »

I am trying to use the subprocess module in the standard library without luck For example:

import pp

def myfunc():
    subprocess.call("hostname")

if __name__ == "__main__":

    job_server = pp.Server()
    j = job_server.submit(myfunc, modules=("subprocess",))
    j()


This gives the error:

Exception in thread run_local:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.6/threading.py", line 477, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.6/dist-packages/pp.py", line 721, in _run_local
    job.finalize(sresult)
UnboundLocalError: local variable 'sresult' referenced before assignment

I know that the error in PP will be fixed in the next version (http://www.parallelpython.com/component/option,com_smf/Itemid,29/topic,604.0), but it also seems like PP clients cant spawn new processes. I guess this may also affect multiprocessing and threading modules as well.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Nutrition facts and analysis