Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5962

Popen does not raise exception

$
0
0

Popen is not raising an exception and so am unable to catch it. Am I missing anything? It prints the error on terminal window as if it succeded. Refer picture. However it lauches properly if valid argument is given.

import subprocesstry:    subprocess.Popen(["xdg-open", "invalid"])    print("Launched")except:    print("Exception")

https://photos.app.goo.gl/G6xWDstUWuL8Py3V6

Environment: Python 3.10.12 [GCC 11.4.0], Ubuntu 22.04.4 LTS


Viewing all articles
Browse latest Browse all 5962

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>