Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tigerhawkvok
Copy link
Contributor

Quashes an error raised by requests -> urllib3 -> stdlib:queue -> stdlib:threading where a pool may be done in a thread and therefore no object to close.

Error encountered in both Python 3.7.8 on Windows 10 and 3.7.11 on Debian 10 ( Docker: python3.7-slim).

Exception ignored in: <function RequestsAdapter.del at 0x7fd2c3fee170>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/geopy/adapters.py", line 431, in del
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 747, in close
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 325, in close
File "/usr/local/lib/python3.7/site-packages/urllib3/poolmanager.py", line 222, in clear
File "/usr/local/lib/python3.7/site-packages/urllib3/_collections.py", line 100, in clear
File "/usr/local/lib/python3.7/site-packages/urllib3/poolmanager.py", line 173, in
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 490, in close
File "/usr/local/lib/python3.7/queue.py", line 181, in get
File "/usr/local/lib/python3.7/threading.py", line 348, in notify
TypeError: 'NoneType' object is not callable

Quashes an error raised by requests -> urllib3 -> stdlib:queue -> stdlib:threading where a pool may be done in a thread and therefore no object to close.

Error encountered in both Python 3.7.8 on Windows 10 and 3.7.11 on Debian 10 ( Docker: python3.7-slim). 


Exception ignored in: <function RequestsAdapter.__del__ at 0x7fd2c3fee170>
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/geopy/adapters.py", line 431, in __del__
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 747, in close
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 325, in close
  File "/usr/local/lib/python3.7/site-packages/urllib3/poolmanager.py", line 222, in clear
  File "/usr/local/lib/python3.7/site-packages/urllib3/_collections.py", line 100, in clear
  File "/usr/local/lib/python3.7/site-packages/urllib3/poolmanager.py", line 173, in <lambda>
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 490, in close
  File "/usr/local/lib/python3.7/queue.py", line 181, in get
  File "/usr/local/lib/python3.7/threading.py", line 348, in notify
TypeError: 'NoneType' object is not callable
Copy link
Member

@KostyaEsmukov KostyaEsmukov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good workaround, thank you!

Copy link
Member

@KostyaEsmukov KostyaEsmukov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tigerhawkvok Could you please fix the linting errors?

  geopy/adapters.py:434:71: W291 trailing whitespace
  geopy/adapters.py:437:66: W291 trailing whitespace

Copy link
Contributor Author

@tigerhawkvok tigerhawkvok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trimmed the two lines of whitespace raised by linter

@KostyaEsmukov KostyaEsmukov merged commit 153c876 into geopy:master Aug 16, 2021
@KostyaEsmukov
Copy link
Member

Perfect, thanks again!

@KostyaEsmukov KostyaEsmukov added this to the 2.3 milestone Aug 16, 2021
sthagen added a commit to sthagen/geopy-geopy that referenced this pull request Aug 16, 2021
Quash TypeError potentially raised by requests -> urllib3 (geopy#488)
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

Successfully merging this pull request may close these issues.

2 participants