Python - Subprocess Popen and Thread error
- by n0idea
In both functions record and ftp, i have subprocess.Popen
if __name__ == '__main__':
try:
t1 = threading.Thread(target = record)
t1.daemon = True
t1.start()
t2 = threading.Thread(target = ftp)
t2.daemon = True
t2.start()
except (KeyboardInterrupt, SystemExit):
sys.exit()
The error I'm receiving is:
Exception in thread Thread-1 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
File "/usr/lib/python2.7/threading.py", line 504, in run
File "./in.py", line 20, in recordaudio
File "/usr/lib/python2.7/subprocess.py", line 493, in call
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
File "/usr/lib/python2.7/subprocess.py", line 1237, in _execute_child
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'close'
What might the issue be ?