I have a script on python3.4 and it has been fine until the website I download the file from decides to use https and now I am getting error but can\'t figure out how I can
for HTTP
people who encountered the error
ValueError: unknown url type: 'http
or
ValueError: unknown url type: b'http
while opening some url like below with urllib.request.Request
'http://localhost/simple_form/insert.php'
just change localhost
to 127.0.0.1
looks like Request method is looking for a domain.something
in url
Most likely your Python installation or operating system is broken.
Python has only support for HTTPS if it was compiled with HTTPS support. However, this should be the default for all sane installations.
HTTPS support is only available if the socket module was compiled with SSL support.
https://docs.python.org/3/library/http.client.html
Please clarify how you installed Python. Official Python distributions are available at python.org
Had this issue, and it was solved by upgrading Python with
brew upgrade python
I had the same problem with Anaconda but after installing the OpenSSL package, it works well.
conda install -c anaconda openssl
For me the error was resolved by downloading the correct version of openssl.
I was using python 3.7.5 32 bit version on windows 10 machine.
goto https://slproweb.com/products/Win32OpenSSL.html and download Win32 OpenSSL v1.1.1h EXE | MSI 54MB Installer version . I used 32 bit as my python interpreter was 32 bit.
Install and run.
Issue fixed :)