Python - ConnectionRefusedError, urllib3.exceptions.NewConnectionError and Colorama
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
So today I was using a script I wrote myself where I noticed that something was wrong. I ran my program with using multiprocessing for few hours and then I got hit with different errors.
The first one is:

The second one is:

The last one:
Traceback (most recent call last):
self.wrapped.write(text[start:end])
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 141, in write
self.write_and_convert(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 169, in write_and_convert
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 141, in write
self.write_and_convert(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 169, in write_and_convert
self.write_plain_text(text, cursor, len(text)) File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 174, in write_plain_text
self.wrapped.write(text[start:end])
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 141, in write
self.write_and_convert(text)
self.wrapped.write(text[start:end])
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 141, in write
self.write_and_convert(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 169, in write_and_convert
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 169, in write_and_convert
self.write_plain_text(text, cursor, len(text))
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 174, in write_plain_text
self.wrapped.write(text[start:end])
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
The problem is that I tried to search for all these three problems where I didnt really found information for Python but I want to ask you guys what does errors means which I can learn what they do and also I also want to know how I would be possible able to avoid them/or retry if it hits with try - except I assume?
Similar stuff what I do is following:
logger = Logger(value)
while True:
try:
url = 'https://www.google.com'
headers = {
'User-Agent': ('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36'
' (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36')
}
requests.packages.urllib3.disable_warnings()
resp = requests.get(url, headers=headers, verify=False, proxies=get_random_proxy(), timeout=12)
resp.raise_for_status()
if resp.status_code == 200 or 301:
return resp.url
except HTTPError as err:
randomtime = random.randint(0, 1)
logger.error('Error HTTPError! - Retrying in {} secs'.format(randomtime))
time.sleep(randomtime)
continue
except requests.exceptions.ConnectionError as err:
randomtime = random.randint(0, 1)
logger.error('Error ConnectionError proxy! - Retrying in {} secs'.format(randomtime))
time.sleep(randomtime)
continue
except requests.exceptions.RequestException as err:
randomtime = random.randint(0, 1)
logger.error('Request error proxy! - Retrying in {} secs'.format(randomtime))
time.sleep(randomtime)
continue
except ssl.SSLWantWriteError:
randomtime = random.randint(0, 1)
logger.error('SSL Write Error! - Retrying in {} secs'.format(randomtime))
time.sleep(randomtime)
continue
except ssl.SSLError as err:
randomtime = random.randint(0, 1)
logger.error('SSL ERROR!n {} - Retrying in {} secs'.format(err, randomtime))
time.sleep(randomtime)
continue
My guess to not getting these error is maybet o do something like
except ConnectionRefusedError as err:
randomtime = random.randint(0, 1)
logger.error('ERROR!n {} - Retrying in {} secs'.format(err, randomtime))
time.sleep(randomtime)
continue
except request.exceptions.ProxyError as err:
randomtime = random.randint(0, 1)
logger.error('ERROR!n {} - Retrying in {} secs'.format(err, randomtime))
time.sleep(randomtime)
continue
Im not sure but I would appreciate for anything. Anything would be appreciated!
python error-handling compiler-errors try-catch
|
show 3 more comments
So today I was using a script I wrote myself where I noticed that something was wrong. I ran my program with using multiprocessing for few hours and then I got hit with different errors.
The first one is:

The second one is:

The last one:
Traceback (most recent call last):
self.wrapped.write(text[start:end])
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 141, in write
self.write_and_convert(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 169, in write_and_convert
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 141, in write
self.write_and_convert(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 169, in write_and_convert
self.write_plain_text(text, cursor, len(text)) File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 174, in write_plain_text
self.wrapped.write(text[start:end])
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 141, in write
self.write_and_convert(text)
self.wrapped.write(text[start:end])
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 141, in write
self.write_and_convert(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 169, in write_and_convert
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 169, in write_and_convert
self.write_plain_text(text, cursor, len(text))
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 174, in write_plain_text
self.wrapped.write(text[start:end])
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
The problem is that I tried to search for all these three problems where I didnt really found information for Python but I want to ask you guys what does errors means which I can learn what they do and also I also want to know how I would be possible able to avoid them/or retry if it hits with try - except I assume?
Similar stuff what I do is following:
logger = Logger(value)
while True:
try:
url = 'https://www.google.com'
headers = {
'User-Agent': ('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36'
' (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36')
}
requests.packages.urllib3.disable_warnings()
resp = requests.get(url, headers=headers, verify=False, proxies=get_random_proxy(), timeout=12)
resp.raise_for_status()
if resp.status_code == 200 or 301:
return resp.url
except HTTPError as err:
randomtime = random.randint(0, 1)
logger.error('Error HTTPError! - Retrying in {} secs'.format(randomtime))
time.sleep(randomtime)
continue
except requests.exceptions.ConnectionError as err:
randomtime = random.randint(0, 1)
logger.error('Error ConnectionError proxy! - Retrying in {} secs'.format(randomtime))
time.sleep(randomtime)
continue
except requests.exceptions.RequestException as err:
randomtime = random.randint(0, 1)
logger.error('Request error proxy! - Retrying in {} secs'.format(randomtime))
time.sleep(randomtime)
continue
except ssl.SSLWantWriteError:
randomtime = random.randint(0, 1)
logger.error('SSL Write Error! - Retrying in {} secs'.format(randomtime))
time.sleep(randomtime)
continue
except ssl.SSLError as err:
randomtime = random.randint(0, 1)
logger.error('SSL ERROR!n {} - Retrying in {} secs'.format(err, randomtime))
time.sleep(randomtime)
continue
My guess to not getting these error is maybet o do something like
except ConnectionRefusedError as err:
randomtime = random.randint(0, 1)
logger.error('ERROR!n {} - Retrying in {} secs'.format(err, randomtime))
time.sleep(randomtime)
continue
except request.exceptions.ProxyError as err:
randomtime = random.randint(0, 1)
logger.error('ERROR!n {} - Retrying in {} secs'.format(err, randomtime))
time.sleep(randomtime)
continue
Im not sure but I would appreciate for anything. Anything would be appreciated!
python error-handling compiler-errors try-catch
If you're gettingConnectionRefusedErrororProxyError, simply trying again is very unlikely to work. Those errors mean something is actually wrong, and will have to be fixed.
– John Gordon
Nov 23 '18 at 19:50
In which way could they be wrong if I might ask and what are you suggestions basically to solve it? @JohnGordon
– Hellosiroverthere
Nov 23 '18 at 19:53
ConnectionRefusedErrormeans that the remote host can't, or doesn't want to, answer your request. Fixing it would depend on why the host isn't answering. Maybe you're trying to connect on the wrong port number, in which case the fix is obvious -- use the correct port number. Or maybe the host is configured to reject requests from your IP address, in which case there's nothing you can do.
– John Gordon
Nov 23 '18 at 20:01
Oh so that means at the end that it could be an Proxy that can be causing it aswell that made the connectionRefusedError to actually happend?
– Hellosiroverthere
Nov 23 '18 at 20:05
I don't know a lot about proxies; I suppose it could happen that way.
– John Gordon
Nov 23 '18 at 20:06
|
show 3 more comments
So today I was using a script I wrote myself where I noticed that something was wrong. I ran my program with using multiprocessing for few hours and then I got hit with different errors.
The first one is:

The second one is:

The last one:
Traceback (most recent call last):
self.wrapped.write(text[start:end])
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 141, in write
self.write_and_convert(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 169, in write_and_convert
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 141, in write
self.write_and_convert(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 169, in write_and_convert
self.write_plain_text(text, cursor, len(text)) File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 174, in write_plain_text
self.wrapped.write(text[start:end])
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 141, in write
self.write_and_convert(text)
self.wrapped.write(text[start:end])
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 141, in write
self.write_and_convert(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 169, in write_and_convert
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 169, in write_and_convert
self.write_plain_text(text, cursor, len(text))
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 174, in write_plain_text
self.wrapped.write(text[start:end])
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
The problem is that I tried to search for all these three problems where I didnt really found information for Python but I want to ask you guys what does errors means which I can learn what they do and also I also want to know how I would be possible able to avoid them/or retry if it hits with try - except I assume?
Similar stuff what I do is following:
logger = Logger(value)
while True:
try:
url = 'https://www.google.com'
headers = {
'User-Agent': ('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36'
' (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36')
}
requests.packages.urllib3.disable_warnings()
resp = requests.get(url, headers=headers, verify=False, proxies=get_random_proxy(), timeout=12)
resp.raise_for_status()
if resp.status_code == 200 or 301:
return resp.url
except HTTPError as err:
randomtime = random.randint(0, 1)
logger.error('Error HTTPError! - Retrying in {} secs'.format(randomtime))
time.sleep(randomtime)
continue
except requests.exceptions.ConnectionError as err:
randomtime = random.randint(0, 1)
logger.error('Error ConnectionError proxy! - Retrying in {} secs'.format(randomtime))
time.sleep(randomtime)
continue
except requests.exceptions.RequestException as err:
randomtime = random.randint(0, 1)
logger.error('Request error proxy! - Retrying in {} secs'.format(randomtime))
time.sleep(randomtime)
continue
except ssl.SSLWantWriteError:
randomtime = random.randint(0, 1)
logger.error('SSL Write Error! - Retrying in {} secs'.format(randomtime))
time.sleep(randomtime)
continue
except ssl.SSLError as err:
randomtime = random.randint(0, 1)
logger.error('SSL ERROR!n {} - Retrying in {} secs'.format(err, randomtime))
time.sleep(randomtime)
continue
My guess to not getting these error is maybet o do something like
except ConnectionRefusedError as err:
randomtime = random.randint(0, 1)
logger.error('ERROR!n {} - Retrying in {} secs'.format(err, randomtime))
time.sleep(randomtime)
continue
except request.exceptions.ProxyError as err:
randomtime = random.randint(0, 1)
logger.error('ERROR!n {} - Retrying in {} secs'.format(err, randomtime))
time.sleep(randomtime)
continue
Im not sure but I would appreciate for anything. Anything would be appreciated!
python error-handling compiler-errors try-catch
So today I was using a script I wrote myself where I noticed that something was wrong. I ran my program with using multiprocessing for few hours and then I got hit with different errors.
The first one is:

The second one is:

The last one:
Traceback (most recent call last):
self.wrapped.write(text[start:end])
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 141, in write
self.write_and_convert(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 169, in write_and_convert
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 141, in write
self.write_and_convert(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 169, in write_and_convert
self.write_plain_text(text, cursor, len(text)) File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 174, in write_plain_text
self.wrapped.write(text[start:end])
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 141, in write
self.write_and_convert(text)
self.wrapped.write(text[start:end])
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 141, in write
self.write_and_convert(text)
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 169, in write_and_convert
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 169, in write_and_convert
self.write_plain_text(text, cursor, len(text))
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 174, in write_plain_text
self.wrapped.write(text[start:end])
File "C:Program FilesPython36libsite-packagescoloramaansitowin32.py", line 40, in write
self.__convertor.write(text)
The problem is that I tried to search for all these three problems where I didnt really found information for Python but I want to ask you guys what does errors means which I can learn what they do and also I also want to know how I would be possible able to avoid them/or retry if it hits with try - except I assume?
Similar stuff what I do is following:
logger = Logger(value)
while True:
try:
url = 'https://www.google.com'
headers = {
'User-Agent': ('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36'
' (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36')
}
requests.packages.urllib3.disable_warnings()
resp = requests.get(url, headers=headers, verify=False, proxies=get_random_proxy(), timeout=12)
resp.raise_for_status()
if resp.status_code == 200 or 301:
return resp.url
except HTTPError as err:
randomtime = random.randint(0, 1)
logger.error('Error HTTPError! - Retrying in {} secs'.format(randomtime))
time.sleep(randomtime)
continue
except requests.exceptions.ConnectionError as err:
randomtime = random.randint(0, 1)
logger.error('Error ConnectionError proxy! - Retrying in {} secs'.format(randomtime))
time.sleep(randomtime)
continue
except requests.exceptions.RequestException as err:
randomtime = random.randint(0, 1)
logger.error('Request error proxy! - Retrying in {} secs'.format(randomtime))
time.sleep(randomtime)
continue
except ssl.SSLWantWriteError:
randomtime = random.randint(0, 1)
logger.error('SSL Write Error! - Retrying in {} secs'.format(randomtime))
time.sleep(randomtime)
continue
except ssl.SSLError as err:
randomtime = random.randint(0, 1)
logger.error('SSL ERROR!n {} - Retrying in {} secs'.format(err, randomtime))
time.sleep(randomtime)
continue
My guess to not getting these error is maybet o do something like
except ConnectionRefusedError as err:
randomtime = random.randint(0, 1)
logger.error('ERROR!n {} - Retrying in {} secs'.format(err, randomtime))
time.sleep(randomtime)
continue
except request.exceptions.ProxyError as err:
randomtime = random.randint(0, 1)
logger.error('ERROR!n {} - Retrying in {} secs'.format(err, randomtime))
time.sleep(randomtime)
continue
Im not sure but I would appreciate for anything. Anything would be appreciated!
python error-handling compiler-errors try-catch
python error-handling compiler-errors try-catch
asked Nov 23 '18 at 19:46
HellosiroverthereHellosiroverthere
11718
11718
If you're gettingConnectionRefusedErrororProxyError, simply trying again is very unlikely to work. Those errors mean something is actually wrong, and will have to be fixed.
– John Gordon
Nov 23 '18 at 19:50
In which way could they be wrong if I might ask and what are you suggestions basically to solve it? @JohnGordon
– Hellosiroverthere
Nov 23 '18 at 19:53
ConnectionRefusedErrormeans that the remote host can't, or doesn't want to, answer your request. Fixing it would depend on why the host isn't answering. Maybe you're trying to connect on the wrong port number, in which case the fix is obvious -- use the correct port number. Or maybe the host is configured to reject requests from your IP address, in which case there's nothing you can do.
– John Gordon
Nov 23 '18 at 20:01
Oh so that means at the end that it could be an Proxy that can be causing it aswell that made the connectionRefusedError to actually happend?
– Hellosiroverthere
Nov 23 '18 at 20:05
I don't know a lot about proxies; I suppose it could happen that way.
– John Gordon
Nov 23 '18 at 20:06
|
show 3 more comments
If you're gettingConnectionRefusedErrororProxyError, simply trying again is very unlikely to work. Those errors mean something is actually wrong, and will have to be fixed.
– John Gordon
Nov 23 '18 at 19:50
In which way could they be wrong if I might ask and what are you suggestions basically to solve it? @JohnGordon
– Hellosiroverthere
Nov 23 '18 at 19:53
ConnectionRefusedErrormeans that the remote host can't, or doesn't want to, answer your request. Fixing it would depend on why the host isn't answering. Maybe you're trying to connect on the wrong port number, in which case the fix is obvious -- use the correct port number. Or maybe the host is configured to reject requests from your IP address, in which case there's nothing you can do.
– John Gordon
Nov 23 '18 at 20:01
Oh so that means at the end that it could be an Proxy that can be causing it aswell that made the connectionRefusedError to actually happend?
– Hellosiroverthere
Nov 23 '18 at 20:05
I don't know a lot about proxies; I suppose it could happen that way.
– John Gordon
Nov 23 '18 at 20:06
If you're getting
ConnectionRefusedError or ProxyError, simply trying again is very unlikely to work. Those errors mean something is actually wrong, and will have to be fixed.– John Gordon
Nov 23 '18 at 19:50
If you're getting
ConnectionRefusedError or ProxyError, simply trying again is very unlikely to work. Those errors mean something is actually wrong, and will have to be fixed.– John Gordon
Nov 23 '18 at 19:50
In which way could they be wrong if I might ask and what are you suggestions basically to solve it? @JohnGordon
– Hellosiroverthere
Nov 23 '18 at 19:53
In which way could they be wrong if I might ask and what are you suggestions basically to solve it? @JohnGordon
– Hellosiroverthere
Nov 23 '18 at 19:53
ConnectionRefusedError means that the remote host can't, or doesn't want to, answer your request. Fixing it would depend on why the host isn't answering. Maybe you're trying to connect on the wrong port number, in which case the fix is obvious -- use the correct port number. Or maybe the host is configured to reject requests from your IP address, in which case there's nothing you can do.– John Gordon
Nov 23 '18 at 20:01
ConnectionRefusedError means that the remote host can't, or doesn't want to, answer your request. Fixing it would depend on why the host isn't answering. Maybe you're trying to connect on the wrong port number, in which case the fix is obvious -- use the correct port number. Or maybe the host is configured to reject requests from your IP address, in which case there's nothing you can do.– John Gordon
Nov 23 '18 at 20:01
Oh so that means at the end that it could be an Proxy that can be causing it aswell that made the connectionRefusedError to actually happend?
– Hellosiroverthere
Nov 23 '18 at 20:05
Oh so that means at the end that it could be an Proxy that can be causing it aswell that made the connectionRefusedError to actually happend?
– Hellosiroverthere
Nov 23 '18 at 20:05
I don't know a lot about proxies; I suppose it could happen that way.
– John Gordon
Nov 23 '18 at 20:06
I don't know a lot about proxies; I suppose it could happen that way.
– John Gordon
Nov 23 '18 at 20:06
|
show 3 more comments
1 Answer
1
active
oldest
votes
Was having a similar issue, tried to catch it with the exception from builtins:
from builtins import ConnectionRefusedError
which seemed like the most obvious solution, however the following worked:
requests.exceptions.ConnectionError
see here
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53452227%2fpython-connectionrefusederror-urllib3-exceptions-newconnectionerror-and-color%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Was having a similar issue, tried to catch it with the exception from builtins:
from builtins import ConnectionRefusedError
which seemed like the most obvious solution, however the following worked:
requests.exceptions.ConnectionError
see here
add a comment |
Was having a similar issue, tried to catch it with the exception from builtins:
from builtins import ConnectionRefusedError
which seemed like the most obvious solution, however the following worked:
requests.exceptions.ConnectionError
see here
add a comment |
Was having a similar issue, tried to catch it with the exception from builtins:
from builtins import ConnectionRefusedError
which seemed like the most obvious solution, however the following worked:
requests.exceptions.ConnectionError
see here
Was having a similar issue, tried to catch it with the exception from builtins:
from builtins import ConnectionRefusedError
which seemed like the most obvious solution, however the following worked:
requests.exceptions.ConnectionError
see here
edited Jan 28 at 14:31
answered Jan 28 at 14:18
cardamomcardamom
2,08811344
2,08811344
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53452227%2fpython-connectionrefusederror-urllib3-exceptions-newconnectionerror-and-color%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
If you're getting
ConnectionRefusedErrororProxyError, simply trying again is very unlikely to work. Those errors mean something is actually wrong, and will have to be fixed.– John Gordon
Nov 23 '18 at 19:50
In which way could they be wrong if I might ask and what are you suggestions basically to solve it? @JohnGordon
– Hellosiroverthere
Nov 23 '18 at 19:53
ConnectionRefusedErrormeans that the remote host can't, or doesn't want to, answer your request. Fixing it would depend on why the host isn't answering. Maybe you're trying to connect on the wrong port number, in which case the fix is obvious -- use the correct port number. Or maybe the host is configured to reject requests from your IP address, in which case there's nothing you can do.– John Gordon
Nov 23 '18 at 20:01
Oh so that means at the end that it could be an Proxy that can be causing it aswell that made the connectionRefusedError to actually happend?
– Hellosiroverthere
Nov 23 '18 at 20:05
I don't know a lot about proxies; I suppose it could happen that way.
– John Gordon
Nov 23 '18 at 20:06