-
Notifications
You must be signed in to change notification settings - Fork 185
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
Python3 v0.11.0 socks.py NameError: name 'basestring' is not defined #100
Conversation
Codecov Report
@@ Coverage Diff @@
## master #100 +/- ##
=========================================
+ Coverage 68.58% 70.38% +1.8%
=========================================
Files 6 6
Lines 2454 2458 +4
=========================================
+ Hits 1683 1730 +47
+ Misses 771 728 -43
Continue to review full report at Codecov.
|
I've added test here 2f59ff9 please include it in PR to keep authorship or else I will squash commits. |
@uu4k update: no action required, we wait for review. Turns out I can push into your master, all this privacy buzz has some substance after all. |
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.
LGTM
Fix is released on PyPI v0.11.3 |
@@ -409,7 +409,7 @@ def connect(self, destpair): | |||
To select the proxy server use setproxy(). | |||
""" | |||
# Do a minimal input check first | |||
if (not type(destpair) in (list,tuple)) or (len(destpair) < 2) or (not isinstance(destpair[0], basestring)) or (type(destpair[1]) != int): | |||
if (not type(destpair) in (list,tuple)) or (len(destpair) < 2) or (not isinstance(destpair[0], str)) or (type(destpair[1]) != int): |
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.
This modification changes the test is type(destpair[0]) is unicode on Python 2. Is that situation possible? The normal fix for this is to define basestring in Python 3.
try:
basestring # Python 2
except NameError:
basestring = str # Python 3
Dear Httplib2 team,
I'm creating tools for gcp with Google API Python Client Library.
I get errors tring to run sample code, and I detect a httplib2 bug for python3.
The builtin
basestring
abstract type was removed on Python3, so I'd like replacebasestring
withstr
.Thanks.