Closed Aquafina-water-bottle closed 1 year ago
Apparently, urllib.request.urlopen takes a very long time to load when using localhost instead of 127.0.0.1 on Windows. This PR simply changes localhost to 127.0.0.1 in the sample code.
urllib.request.urlopen
localhost
127.0.0.1
I initially thought of doing something like:
import platform url = "127.0.0.1" if platform.system() == "Windows" else "localhost"
However, given that the Javascript example is using 127.0.0.1 already, I figured it is fine to replace localhost entirely.
Related issue & more reading material: #389
How bizarre! Anyways, thanks for the fix!
Apparently,
urllib.request.urlopen
takes a very long time to load when usinglocalhost
instead of127.0.0.1
on Windows. This PR simply changeslocalhost
to127.0.0.1
in the sample code.I initially thought of doing something like:
However, given that the Javascript example is using 127.0.0.1 already, I figured it is fine to replace
localhost
entirely.Related issue & more reading material: #389