Answer the question
In order to leave comments, you need to log in
PySocks error `0x04` - Host unreachable. how to handle the error and continue executing the code?
I am writing a program that checks Tor sites for availability (operability), but
I get an error:
PySocks error `0x04` - Host unreachable. when trying to access a non-existent .onion URL
Error description from the PySocks library documentation:
"`0x04` - Host unreachable - The target could not be contacted. A router on the network
had replied with a destination host unreachable error.
"
how to handle this error so that the code would continue executing even after the appearance of such an error??
Answer the question
In order to leave comments, you need to log in
import decimal, sys, re, math, urllib, subprocess, random, warnings
PIPE = subprocess.PIPE
warnings.filterwarnings("ignore")
check = subprocess.Popen("torify curl -s http://icanhazip.com/",stderr=None, stdout=PIPE, shell=PIPE)
check = str(check.stdout.read())
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question