You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.
Documenting it for those poor souls who are still stuck with hyper under Python2.7.
Passing a Unicode object (not an "str") in Python2.7 to a hyper.tls.init_context as a cert argument raises an exception IOError: [Errno 21] Is a directory.
This happens because "basestring" is erroneously set to (str, str) here:
Note that because of the assignment to the basestring on line 127, an attempt to dereference the object before will always raise NameError, because the interpreter will consider basestring as a local variable. The behavior is explained in the Python FAQ, and the solution is to declare basestring as global explicitly.
The text was updated successfully, but these errors were encountered:
imankulov
changed the title
basestring is erroneously ignores unicode in Python2.7
basestring erroneously ignores unicode in Python2.7
Jun 11, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Documenting it for those poor souls who are still stuck with hyper under Python2.7.
Passing a Unicode object (not an "str") in Python2.7 to a
hyper.tls.init_context
as acert
argument raises an exceptionIOError: [Errno 21] Is a directory
.This happens because "basestring" is erroneously set to (str, str) here:
hyper/hyper/tls.py
Lines 123 to 127 in 18b629b
Note that because of the assignment to the
basestring
on line 127, an attempt to dereference the object before will always raise NameError, because the interpreter will considerbasestring
as a local variable. The behavior is explained in the Python FAQ, and the solution is to declarebasestring
as global explicitly.The text was updated successfully, but these errors were encountered: