httpx icon indicating copy to clipboard operation
httpx copied to clipboard

Encountering a Strange Bug While Running Golang Compiled Program from Python using subprocess.run()

Open Miracles666 opened this issue 2 years ago • 0 comments

I encountered a very strange bug. I want to use Python to call a Golang compiled httpx program by running test.py script. Here's the code:

java Copy code import subprocess

cmd = "sudo /home/miracles/xxxx/client/subdomain/thirdparty/httpx/httpx -t 30 -rl 60 -fr -ec -sc -cl -title -td -l /home/miracles/jx-scan/client/subdomain/results/temp/domains_tmp_1681376467_XpFhcHfcOJ.txt "

subprocess.run(cmd, shell=True) When I run the program by right-clicking on it in PyCharm and selecting 'run', it gets stuck and doesn't work, like this:

   __    __  __       _  __
   / /_  / /_/ /_____ | |/ /
  / __ \/ __/ __/ __ \|   /
 / / / / /_/ /_/ /_/ /   |
/_/ /_/\__/\__/ .___/_/|_|
             /_/

  projectdiscovery.io

[INF] Current httpx version v1.2.9 (latest)

It doesn't return any results. However, when I run the code using the command python3 test.py, it successfully returns the expected results:

    __    __  __       _  __
   / /_  / /_/ /_____ | |/ /
  / __ \/ __/ __/ __ \|   /
 / / / / /_/ /_/ /_/ /   |
/_/ /_/\__/\__/ .___/_/|_|
             /_/

                projectdiscovery.io

[INF] Current httpx version v1.2.9 (latest)
http://www.xxxx.com.cn [302,301,302,200] [126084] [xxxxxx务] [https://www.xxx.com/official/home-a?channel_id=1]

I noticed that this issue only occurs with binaries from Project Discovery, as their other products like naabu also have the same problem."

Miracles666 avatar Apr 13 '23 13:04 Miracles666