question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Request fails in python subprocess

See original GitHub issue

Summary

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:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sigmavirus24commented, Jul 30, 2020

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

0reactions
vijay120commented, Jul 31, 2020

Got it, thanks for the insight.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found