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
Getting "TypeError: can't concat str to bytes" while using proxy_type=PROXY_TYPE_SOCKS5 #144
Comments
@mahirchavda hello. Thanks for great bug report with test. fc5986c this is fix if you need super fast. Our merge/release process typically takes 1-3 calendar days. |
Oh and if you just use bytes for proxy user/pass in your code - that's kind of solution too. |
@temoto Thanks for quick fix |
Hi @temoto, I'm still getting same error. I performed below step in order to test the latest code $ python3 -m pip uninstall httplib2
$ git clone https://github.com/httplib2/httplib2.git
$ cd httplib2
$ git checkout proxy-auth-bytes
$ python3 setup.py install
$ C:/Python37/python3.exe c:/Users/myuser/Desktop/r.py The same stack trace:
|
I also tried to use bytes for proxy user/pass. It is throwing the same error. |
Sorry, I thought there is one obvious code location that could influence
this and didn't run your test. Will do more thorough job this time.
…On Sat, Sep 14, 2019, 02:39 mahirchavda ***@***.***> wrote:
I also tried to use bytes for proxy user/pass. It is throwing the same
error.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#144?email_source=notifications&email_token=AAAGTMN4GIK5JF3F5WNUO2LQJQCBNA5CNFSM4IWPIEZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6WIHQY#issuecomment-531399619>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAGTMLOY3LKFXBOA7V5KSTQJQCBNANCNFSM4IWPIEZA>
.
|
@mahirchavda there were two places with incorrect str/bytes type, this version works eb7190b |
It is working now. Thanks for the help @temoto. |
@temoto Is it ok to apply this patch in our codebase? |
@mahirchavda yes, the bug fix part of this patch is fine and will not change. We are discussing test related nuances that may change before merge into master. |
I see. Thank You. |
Out of curiosity, Why it is trying to import PySocks first in the python3? PySocks don't have support for proxy_type=PROXY_TYPE_HTTP_NO_TUNNEL. # File: python3/httplib2/__init__.py
try:
import socks
except ImportError:
# TODO: remove this fallback and copypasted socksipy module upon py2/3 merge,
# idea is to have soft-dependency on any compatible module called socks
from . import socks |
I remember one request to use system-wide socks. It kinda makes sense to remain small HTTP library and offload proxy job. |
@temoto Can I close this issue? |
@mahirchavda if you feel that the problem is solved, of course go ahead. |
Thanks. It is resolved in v0.14.0 Hence closing this issue. |
Stacktrace:
System Detail:
Source code(r.py):
The text was updated successfully, but these errors were encountered: