--> -->
 
 
InvalidURL
Python 3.4.2: /usr/bin/python3.4
Wed May 12 19:43:24 2021

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 /home/thbz/www/prog/mouve/index.cgi in ()
      5 cgitb.enable()
      6 print('Content-Type: text/html; charset=utf-8\r\n\r\n')
      7 sys.path.append(os.environ['HOME'] + '/prog/mouve')
=>    8 import mouve
      9 
mouve undefined
 /homez.476/thbz/prog/mouve/mouve.py in ()
   1305         pre(desc)
   1306 
   1307     footer()
   1308 
=> 1309 main()
main = <function main>
 /homez.476/thbz/prog/mouve/mouve.py in main()
   1172     if 'req' in cgi_args and cgi_args['req'].value:
   1173         req = cgi_args['req'].value
=> 1174         res_doc = get_document(req, cgi_args)
   1175         if "do_redirect" in res_doc and res_doc["do_redirect"] == True:
   1176             redirect(res_doc["url"])
res_doc undefined, global get_document = <function get_document>, req = 'mailto:accommodations-ext@fb.com', cgi_args = FieldStorage(None, None, [MiniFieldStorage('req', 'mailto:accommodations-ext@fb.com')])
 /homez.476/thbz/prog/mouve/mouve.py in get_document(desc='mailto:accommodations-ext@fb.com', cgi_args=FieldStorage(None, None, [MiniFieldStorage('req', 'mailto:accommodations-ext@fb.com')]), get_contenu=False)
   1049                 try:
   1050                     r = urllib.request.Request(url)
=> 1051                     with urllib.request.urlopen(r) as req:
   1052                         res = req.read()
   1053                 except urllib.error.URLError as exc:
global urllib = <module 'urllib' from '/usr/lib/python3.4/urllib/__init__.py'>, urllib.request = <module 'urllib.request' from '/usr/lib/python3.4/urllib/request.py'>, urllib.request.urlopen = <function urlopen>, r = <urllib.request.Request object>, req undefined
 /usr/lib/python3.4/urllib/request.py in urlopen(url=<urllib.request.Request object>, data=None, timeout=<object object>, cafile=None, capath=None, cadefault=False)
    151     else:
    152         opener = _opener
=>  153     return opener.open(url, data, timeout)
    154 
    155 def install_opener(opener):
opener = <urllib.request.OpenerDirector object>, opener.open = <bound method OpenerDirector.open of <urllib.request.OpenerDirector object>>, url = <urllib.request.Request object>, data = None, timeout = <object object>
 /usr/lib/python3.4/urllib/request.py in open(self=<urllib.request.OpenerDirector object>, fullurl=<urllib.request.Request object>, data=None, timeout=<object object>)
    453             req = meth(req)
    454 
=>  455         response = self._open(req, data)
    456 
    457         # post-process response
response undefined, self = <urllib.request.OpenerDirector object>, self._open = <bound method OpenerDirector._open of <urllib.request.OpenerDirector object>>, req = <urllib.request.Request object>, data = None
 /usr/lib/python3.4/urllib/request.py in _open(self=<urllib.request.OpenerDirector object>, req=<urllib.request.Request object>, data=None)
    471         protocol = req.type
    472         result = self._call_chain(self.handle_open, protocol, protocol +
=>  473                                   '_open', req)
    474         if result:
    475             return result
req = <urllib.request.Request object>
 /usr/lib/python3.4/urllib/request.py in _call_chain(self=<urllib.request.OpenerDirector object>, chain={'data': [<urllib.request.DataHandler object>], 'file': [<urllib.request.FileHandler object>], 'ftp': [<urllib.request.FTPHandler object>], 'http': [<urllib.request.HTTPHandler object>], 'https': [<urllib.request.HTTPSHandler object>], 'unknown': [<urllib.request.UnknownHandler object>]}, kind='http', meth_name='http_open', *args=(<urllib.request.Request object>,))
    431         for handler in handlers:
    432             func = getattr(handler, meth_name)
=>  433             result = func(*args)
    434             if result is not None:
    435                 return result
result undefined, func = <bound method HTTPHandler.http_open of <urllib.request.HTTPHandler object>>, args = (<urllib.request.Request object>,)
 /usr/lib/python3.4/urllib/request.py in http_open(self=<urllib.request.HTTPHandler object>, req=<urllib.request.Request object>)
   1200 
   1201     def http_open(self, req):
=> 1202         return self.do_open(http.client.HTTPConnection, req)
   1203 
   1204     http_request = AbstractHTTPHandler.do_request_
self = <urllib.request.HTTPHandler object>, self.do_open = <bound method HTTPHandler.do_open of <urllib.request.HTTPHandler object>>, global http = <module 'http' from '/usr/lib/python3.4/http/__init__.py'>, http.client = <module 'http.client' from '/usr/lib/python3.4/http/client.py'>, http.client.HTTPConnection = <class 'http.client.HTTPConnection'>, req = <urllib.request.Request object>
 /usr/lib/python3.4/urllib/request.py in do_open(self=<urllib.request.HTTPHandler object>, http_class=<class 'http.client.HTTPConnection'>, req=<urllib.request.Request object>, **http_conn_args={})
   1142 
   1143         # will parse host:port
=> 1144         h = http_class(host, timeout=req.timeout, **http_conn_args)
   1145 
   1146         headers = dict(req.unredirected_hdrs)
h undefined, http_class = <class 'http.client.HTTPConnection'>, host = 'mailto:accommodations-ext@fb.com', timeout undefined, req = <urllib.request.Request object>, req.timeout = <object object>, http_conn_args = {}
 /usr/lib/python3.4/http/client.py in __init__(self=<http.client.HTTPConnection object>, host='mailto:accommodations-ext@fb.com', port=None, timeout=<object object>, source_address=None)
    787         self._tunnel_headers = {}
    788 
=>  789         (self.host, self.port) = self._get_hostport(host, port)
    790 
    791         # This is stored as an instance variable to allow unit
self = <http.client.HTTPConnection object>, self.host undefined, self.port undefined, self._get_hostport = <bound method HTTPConnection._get_hostport of <http.client.HTTPConnection object>>, host = 'mailto:accommodations-ext@fb.com', port = None
 /usr/lib/python3.4/http/client.py in _get_hostport(self=<http.client.HTTPConnection object>, host='mailto:accommodations-ext@fb.com', port=None)
    829                         port = self.default_port
    830                     else:
=>  831                         raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
    832                 host = host[:i]
    833             else:
global InvalidURL = <class 'http.client.InvalidURL'>, host = 'mailto:accommodations-ext@fb.com', i = 6

InvalidURL: nonnumeric port: 'accommodations-ext@fb.com'
      args = ("nonnumeric port: 'accommodations-ext@fb.com'",)
      with_traceback = <built-in method with_traceback of InvalidURL object>