Request fails in python subprocess
See original GitHub issueSummary
The request library stalls in a python subprocess and does not fulfill the request.
Expected Result
The line “after call” should be printed and the response to the GET request should also be printed.
Actual Result
The subprocess stalls at “before call” and does not print “after call” and the response to the GET request.
Reproduction Steps
import requests
from multiprocessing import Process
def call_locahost():
print("before call")
response = requests.request("GET", "https://www.google.com/")
print("after call")
print(response)
return response
p = Process(target=call_locahost)
p.start()
p.join()
System Information
(botlite) VIJAYRK-M-L1E5:botlite vijay$ python -m requests.help
{
"chardet": {
"version": "3.0.4"
},
"cryptography": {
"version": ""
},
"idna": {
"version": "2.9"
},
"implementation": {
"name": "CPython",
"version": "3.6.5"
},
"platform": {
"release": "17.7.0",
"system": "Darwin"
},
"pyOpenSSL": {
"openssl_version": "",
"version": null
},
"requests": {
"version": "2.23.0"
},
"system_ssl": {
"version": "1010107f"
},
"urllib3": {
"version": "1.25.9"
},
"using_pyopenssl": false
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Subprocess call fails - python - Stack Overflow
There are two solutions you could use, either expand the ~ in python using os.path.expanduser or call subprocess.call ...
Read more >subprocess — Subprocess management — Python 3.11.1 ...
To determine if the shell failed to find the requested application, it is necessary to check the return code or output from the...
Read more >The subprocess Module: Wrapping Programs With Python
In this tutorial, you'll learn how to leverage other apps and programs that aren't Python, wrapping them or launching them from your Python...
Read more >continue if 'subprocess.call' failes - Python Forum
Sometimes, a new Host has a bad configuration and it asks for UserName... I thought I can use try/except to keep going if...
Read more >Python Subprocess Module - Running external programs
Content. method summary; shell parameter summary; Basic Usage - primary function calls. check_call; check_output; call; Popen. Error Checking.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m on MacOS too. I don’t see this across any macOS environment or Linux environment. I’d check your DNS settings and find evidence that this is actually a problem with this project - of which there is currently none
Got it, thanks for the insight.