Atom Runner 8080 proxy error


#1

Hi All - When I run the below code in atom runner i get an odd trace back error. (Code and error below)

However if i run the code from command line or spyder ide it executes as expected. I’m guessing this is a config setting for atom runner but haven’t been able to debug. Any help would much appreciated. I’m new to atom and python so i’m guessing this is a pretty simple thing that I don;t understand

Thanks

import urllib.request

fhand = urllib.request.urlopen(‘http://data.pr4e.org/intro-short.txt’)
for line in fhand:
print(line.decode().strip())

Atom Runner: urllib1.py
Traceback (most recent call last):
File “C:\apps\Program Files\Continuum\anaconda3\lib\http\client.py”, line 885, in _get_hostport
port = int(host[i+1:])
ValueError: invalid literal for int() with base 10: ‘8080;PROXY’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\justin.walker2\Desktop\py4e\sample_code\urllib1.py”, line 3, in
fhand = urllib.request.urlopen(‘http://data.pr4e.org/intro-short.txt’)
File “C:\apps\Program Files\Continuum\anaconda3\lib\urllib\request.py”, line 223, in urlopen
return opener.open(url, data, timeout)
File “C:\apps\Program Files\Continuum\anaconda3\lib\urllib\request.py”, line 526, in open
response = self._open(req, data)
File “C:\apps\Program Files\Continuum\anaconda3\lib\urllib\request.py”, line 544, in _open
‘_open’, req)
File “C:\apps\Program Files\Continuum\anaconda3\lib\urllib\request.py”, line 504, in _call_chain
result = func(*args)
File “C:\apps\Program Files\Continuum\anaconda3\lib\urllib\request.py”, line 1346, in http_open
return self.do_open(http.client.HTTPConnection, req)
File “C:\apps\Program Files\Continuum\anaconda3\lib\urllib\request.py”, line 1286, in do_open
h = http_class(host, timeout=req.timeout, **http_conn_args)
File “C:\apps\Program Files\Continuum\anaconda3\lib\http\client.py”, line 849, in init
(self.host, self.port) = self._get_hostport(host, port)
File “C:\apps\Program Files\Continuum\anaconda3\lib\http\client.py”, line 890, in _get_hostport
raise InvalidURL(“nonnumeric port: ‘%s’” % host[i+1:])
http.client.InvalidURL: nonnumeric port: ‘8080;PROXY’


#2

Do you happen to have multiple versions of Python installed on your computer? Because it’s possible that atom-runner could be using a different one from the one you’re using from the command line. What command are you using when you do it manually?


#4

This is what i run from the cmd line screen, I thought it may be an issue with the corporate firewall but it works in spyder from anaconda navigator and cmd line screen so it seems to be an issue with how i’ve set-up atom

C:\Users\justin.walker2\Desktop\py4e\sample_code>python urllib1.py


#5

What happens when you try to use another package, like script or process-palette? Honestly, if you’re familiar with the command line, process-palette gives you so much more power and automation potential than the others.


#6

so i set-up script and also ran into the same issue. I also tried platmormio-ide-terminal and ran into the same issue. I also downloaded py charm and it worked perfectly. Running out of ideas but it feels like something hasn’t been set-up correctly

Traceback (most recent call last):
File “C:\apps\Program Files\Continuum\anaconda3\lib\http\client.py”, line 885, in _get_hostport
port = int(host[i+1:])
ValueError: invalid literal for int() with base 10: ‘8080;PROXY’

During handling of the above exception, another exception occurred:


#7

I’m pretty sure I haven’t seen that error anywhere before, but I also haven’t ever used Anaconda. My Python work has been focused on Django.