censusgeocode
censusgeocode copied to clipboard
Fixed Urllib error (Issue #29)
Library was giving urllib errors for python > 3.9 Error was (similar error in python 3.11.9)
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/requests_toolbelt/_compat.py", line 48, in <module>
from requests.packages.urllib3.contrib import appengine as gaecontrib
ImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' (/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/urllib3/contrib/__init__.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/unittest/loader.py", line 154, in loadTestsFromName
module = __import__(module_name)
File "/home/runner/work/censusgeocode-test/censusgeocode-test/tests/__init__.py", line 10, in <module>
from . import test_censusgeocode
File "/home/runner/work/censusgeocode-test/censusgeocode-test/tests/test_censusgeocode.py", line 14, in <module>
from censusgeocode import CensusGeocode
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/censusgeocode/__init__.py", line 10, in <module>
from .censusgeocode import CensusGeocode
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/censusgeocode/censusgeocode.py", line 26, in <module>
from requests_toolbelt.multipart.encoder import MultipartEncoder
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/requests_toolbelt/__init__.py", line 12, in <module>
from .adapters import SSLAdapter, SourceAddressAdapter
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/requests_toolbelt/adapters/__init__.py", line 12, in <module>
from .ssl import SSLAdapter
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/requests_toolbelt/adapters/ssl.py", line 16, in <module>
from .._compat import poolmanager
File "/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/requests_toolbelt/_compat.py", line 50, in <module>
from urllib3.contrib import appengine as gaecontrib
ImportError: cannot import name 'appengine' from 'urllib3.contrib' (/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/urllib3/contrib/__init__.py)
Allowed requests-toolbelt > 0.9.0 be allowed. requests-toolbelt 1.0.0 fixes the issue.
Issue #29
@MrMalfunction Thank you for the PR; this fixes an issue I am running into on python 3.11
@fitnr Are you going to create a new release for pypi ? Just asking as we are currently cloning the repo for usage in our project.
I will sometime in the next 48 hours.