Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

urllib3.exceptions.LocationParseError: Failed to parse #11283

Closed
nickwebha opened this issue May 29, 2020 · 6 comments
Closed

urllib3.exceptions.LocationParseError: Failed to parse #11283

nickwebha opened this issue May 29, 2020 · 6 comments

Comments

@nickwebha
Copy link

nickwebha commented May 29, 2020

This is my command:

em++																										\
	-o "output.js"																							\
	client/source/*.cpp																						\
	-std=c++17 -pipe																						\
	-Wall -Werror																							\
	-Iinclude/ -Iclient/include/																			\
	-g4 --source-map-base "/"																				\
	--profiling																								\
	-s ALLOW_MEMORY_GROWTH=1 -s WASM_MEM_MAX=1GB															\
	-s ASSERTIONS=2 -s SAFE_HEAP=1 -s STACK_OVERFLOW_CHECK=2 -s DEMANGLE_SUPPORT=1							\
	-s DISABLE_EXCEPTION_CATCHING=0																			\
	-s USE_PTHREADS=1																						\
	-s USE_SDL=2 -s USE_SDL_TTF=2 -s USE_SDL_MIXER=2 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='[ "png" ]'	\
	-s EXTRA_EXPORTED_RUNTIME_METHODS='[ "ccall", "cwrap" ]'												\
	-s EXPORTED_FUNCTIONS='[ "_main" ]'																		\
	-s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1														\
	-O0

A month ago I installed Emscripten. Everything was working great. Tonight I upgraded via the guide.

Now I get:

system_libs:INFO: retrieving port: zlib from https://github.com/emscripten-ports/zlib/archive/version_1.zip
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/models.py", line 379, in prepare_url
    scheme, auth, host, port, path, query, fragment = parse_url(url)
  File "/usr/lib/python3/dist-packages/urllib3/util/url.py", line 392, in parse_url
    return six.raise_from(LocationParseError(source_url), None)
  File "<string>", line 3, in raise_from
urllib3.exceptions.LocationParseError: Failed to parse: https://github.com/emscripten-ports/zlib/archive/version_1.zip

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/nick/emsdk/upstream/emscripten/em++.py", line 14, in <module>
    sys.exit(emcc.run(sys.argv))
  File "/home/nick/emsdk/upstream/emscripten/emcc.py", line 2204, in run
    compile_source_file(i, input_file)
  File "/home/nick/emsdk/upstream/emscripten/emcc.py", line 2180, in compile_source_file
    cmd = get_clang_command([input_file])
  File "/home/nick/emsdk/upstream/emscripten/emcc.py", line 2145, in get_clang_command
    return system_libs.process_args(args, shared.Settings)
  File "/home/nick/emsdk/upstream/emscripten/tools/system_libs.py", line 1968, in process_args
    args = port.process_args(Ports, args, settings, shared)
  File "/home/nick/emsdk/upstream/emscripten/tools/ports/zlib.py", line 55, in process_args
    get(ports, settings, shared)
  File "/home/nick/emsdk/upstream/emscripten/tools/ports/zlib.py", line 17, in get
    ports.fetch_project('zlib', 'https://github.com/emscripten-ports/zlib/archive/' + TAG + '.zip', 'zlib-' + TAG, sha512hash=HASH)
  File "/home/nick/emsdk/upstream/emscripten/tools/system_libs.py", line 1917, in fetch_project
    retrieve()
  File "/home/nick/emsdk/upstream/emscripten/tools/system_libs.py", line 1855, in retrieve
    response = requests.get(url)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 519, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 452, in prepare_request
    p.prepare(
  File "/usr/lib/python3/dist-packages/requests/models.py", line 313, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python3/dist-packages/requests/models.py", line 381, in prepare_url
    raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: https://github.com/emscripten-ports/zlib/archive/version_1.zip

I even tried deleting and reinstalling from scratch.

When I try to download https://github.com/emscripten-ports/zlib/archive/version_1.zip manually from a browser it downloads fine.

@sbc100
Copy link
Collaborator

sbc100 commented May 29, 2020

That pretty strange. Clearly that error looks pretty reasonable.

What version of python3-requests to you have installed ? (what does dpkg -l python3-requests say?)

Can you run python3 -c "import requests; requests.get('https://github.com/emscripten-ports/zlib/archive/version_1.zip')" ?

@nickwebha
Copy link
Author

What version of python3-requests to you have installed ? (what does dpkg -l python3-requests say?)

dpkg -l python3-requests

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name             Version         Architecture Description
+++-================-===============-============-===================================================================
ii  python3-requests 2.22.0-2ubuntu1 all          elegant and simple HTTP library for Python3, built for human beings

Can you run python3 -c "import requests; requests.get('https://github.com/emscripten-ports/zlib/archive/version_1.zip')" ?

python3 -c "import requests; requests.get('https://github.com/emscripten-ports/zlib/archive/version_1.zip')"

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/models.py", line 379, in prepare_url
    scheme, auth, host, port, path, query, fragment = parse_url(url)
  File "/usr/lib/python3/dist-packages/urllib3/util/url.py", line 392, in parse_url
    return six.raise_from(LocationParseError(source_url), None)
  File "<string>", line 3, in raise_from
urllib3.exceptions.LocationParseError: Failed to parse: https://github.com/emscripten-ports/zlib/archive/version_1.zip

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 519, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 452, in prepare_request
    p.prepare(
  File "/usr/lib/python3/dist-packages/requests/models.py", line 313, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python3/dist-packages/requests/models.py", line 381, in prepare_url
    raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: https://github.com/emscripten-ports/zlib/archive/version_1.zip

This is all on a fresh install from when Ubuntu 20.04 MATE was released.

@sbc100
Copy link
Collaborator

sbc100 commented May 29, 2020

How about python3 -c "import requests; requests.get('https://google.com') ?

Looks like there is a some kind of issue with that package... I would continue to investigate and perhaps file an upstream issue nothing obvious seems be to wrong with your installation.

@sbc100
Copy link
Collaborator

sbc100 commented May 29, 2020

Sadly the code at line 392 of urllib3/util/url.py seems to throw away the actual exception.. so its not clear what is going wrong other than that parsing failed.

@sbc100
Copy link
Collaborator

sbc100 commented May 29, 2020

maybe try apt-get install --reinstall python3 python3-requests libpython3.8-minimal ?

(assuming you are on python 3.8. if not replace with the correct version).

@nickwebha
Copy link
Author

nickwebha commented May 29, 2020

How about python3 -c "import requests; requests.get('https://google.com') ?

Looks like there is a some kind of issue with that package... I would continue to investigate and perhaps file an upstream issue nothing obvious seems be to wrong with your installation.

It appears you are right. python3 -c "import requests; requests.get('https://google.com')" gives the same error.

maybe try apt-get install --reinstall python3 python3-requests libpython3.8-minimal ?

Reinstalling did not help.

Now I have more information. Thank you for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants