httplib2 / httplib2

Small, fast HTTP client library for Python. Features persistent connections, cache, and Google App Engine support. Originally written by Joe Gregorio, now supported by community.
http://httplib2.readthedocs.io/
Other
488 stars 185 forks source link

Recursive _errno_from_exception #228

Closed gustafsson closed 1 year ago

gustafsson commented 2 years ago

Similar to https://github.com/httplib2/httplib2/pull/202 but the socket.error may also have empty args so check the length again, or revert to the errno field.

When I was using a proxy that dropped the connection I got this error message

socks.GeneralProxyError: Connection closed unexpectedly

During handling of the above exception, another exception occurred:
...
  File "~/Applications/google-cloud-sdk/platform/gsutil/third_party/httplib2/python3/httplib2/__init__.py", line 195, in _errno_from_exception
    return e_int.args[0].errno if isinstance(e_int.args[0], socket.error) else e_int.errno
IndexError: tuple index out of range

httplib2_IndexError_tuple_index_out_of_range.txt

codecov[bot] commented 1 year ago

Codecov Report

Merging #228 (1141e7e) into master (a309035) will decrease coverage by 0%. The diff coverage is 75%.

Additional details and impacted files | [Impacted Files](https://codecov.io/gh/httplib2/httplib2/pull/228?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=httplib2) | Coverage Δ | | |---|---|---| | [python3/httplib2/\_\_init\_\_.py](https://codecov.io/gh/httplib2/httplib2/pull/228/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=httplib2#diff-cHl0aG9uMy9odHRwbGliMi9fX2luaXRfXy5weQ==) | `83% <75%> (-1%)` | :arrow_down: | | [python2/httplib2/\_\_init\_\_.py](https://codecov.io/gh/httplib2/httplib2/pull/228/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=httplib2#diff-cHl0aG9uMi9odHRwbGliMi9fX2luaXRfXy5weQ==) | `83% <0%> (+<1%)` | :arrow_up: |
temoto commented 1 year ago

thank you, recursive version is cleaner