Skip to content

Python 3.8 urllib issue #714

@1995parham

Description

@1995parham

In python 3.8 the following code:

urllib.request.urlopen('file:///home/parham/.bashrc')

Generates the following error:

Traceback (most recent call last):                                                                                                      
  File "<stdin>", line 1, in <module>                                                                                                   
  File "/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.8.5/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)                                                                                              
  File "/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.8.5/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)                                                                                                    
  File "/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.8.5/lib/python3.8/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, 'default',                                                                              
  File "/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.8.5/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)                                                                                                                
  File "/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.8.5/lib/python3.8/urllib/request.py", line 806, in <lambda>
    meth(r, proxy, type))                                                                                                               
  File "/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.8.5/lib/python3.8/urllib/request.py", line 834, in proxy_open
    return self.parent.open(req, timeout=req.timeout)                                                                                   
  File "/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.8.5/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)                                                                                                      
  File "/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.8.5/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(                                                                                                       
  File "/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.8.5/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)                                                                                                      
  File "/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.8.5/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)                                                                                                                
  File "/home/linuxbrew/.linuxbrew/Cellar/[email protected]/3.8.5/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)                                                                                  
urllib.error.HTTPError: HTTP Error 400: Bad Request                                                                                     

And this cause issue with validator when it tries to fetch a local schema file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    InvalidNot a bug, PEBKAC, or an unsupported setup

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions