[Tutor] Please correct my error handling

David Rock david at graniteweb.com
Thu Jan 2 13:43:06 EST 2020


* David Rock <david at graniteweb.com> [2020-01-02 12:39]:
> 
> The problem is process.communicate() is thowing an exception.  That's
> not the same thing as getting stdout, stderr
> 
> Traceback (most recent call last):
>   File "test.py", line 6, in <module>
>     stderr=subprocess.PIPE,
>   File "/usr/lib/python3.5/subprocess.py", line 676, in __init__
>     restore_signals, start_new_session)
>   File "/usr/lib/python3.5/subprocess.py", line 1282, in _execute_child
>     raise child_exception_type(errno_num, err_msg)
> FileNotFoundError: [Errno 2] No such file or directory: '/bin/lsd'
> 

Oops, I should look closer at my own tracebacks.  As mentioned, this is
an exception in popen, not subprocess.communicate().  It's not even
getting that far.

-- 
David Rock
david at graniteweb.com


More information about the Tutor mailing list