New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle PySocks ProxyConnectionError #202
Conversation
f0ca992
to
007089f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
Please, extract it to function errno_from_exception
or some better name, then I can add documenting comments.
Is anything else needed to be done for this PR, @temoto? |
In the presence of PySocks, httplib2 falls back on it instead of its own bundled `socks.py`. However, exception `ProxyConnectionError` produced by PySocks is a bit different that expected, it lacks `args`. An attempt to extract `errno` from it fails with `IndexError: tuple index out of range` (see httplib2#170). The patch addresses this.
@ivanyu sorry, I was trying to restore CI on Github Actions before doing any merges. It's in master now. Thank you for your work. Please emote rocket if you need this in pypi sooner. |
Released in |
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
0.20.2 auth: support pyparsing v3 (AttributeError downcaseTokens) httplib2/httplib2#207 proxy: correct extraction of errno from pysocks ProxyConnectionError httplib2/httplib2#202 Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
In the presence of PySocks, httplib2 falls back on it instead of its own bundled
socks.py
. However, exceptionProxyConnectionError
produced by PySocks is a bit different that expected, it lacksargs
. An attempt to extracterrno
from it fails withIndexError: tuple index out of range
(see #170). The patch addresses this.