how do you print out errors from curl command

50 Views Asked by At

I am trying to use shlex library to run a curl command. I need to print out the errors. I have done the following but I dont see any errors.

import shlex
url='test.com'
args = shlex.split(url)

process = subprocess.Popen(args, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
print(stderr)

It is not pringing any errors. Any ideas?

0

There are 0 best solutions below