Title: basestring erroneously ignores unicode in Python2.7 · Issue #432 · python-hyper/hyper · GitHub
Open Graph Title: basestring erroneously ignores unicode in Python2.7 · Issue #432 · python-hyper/hyper
X Title: basestring erroneously ignores unicode in Python2.7 · Issue #432 · python-hyper/hyper
Description: 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 director...
Open Graph Description: 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 exc...
X Description: 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 rai...
Opengraph URL: https://github.com/python-hyper/hyper/issues/432
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"basestring erroneously ignores unicode in Python2.7","articleBody":"Documenting it for those poor souls who are still stuck with hyper under Python2.7.\r\n\r\nPassing 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`.\r\n\r\nThis happens because \"basestring\" is erroneously set to (str, str) here: \r\n\r\nhttps://github.com/python-hyper/hyper/blob/18b629b8487169870235fe13387e2ae03c178b9f/hyper/tls.py#L123-L127\r\n\r\nNote 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](https://docs.python.org/3/faq/programming.html#why-am-i-getting-an-unboundlocalerror-when-the-variable-has-a-value), and the solution is to declare `basestring` as global explicitly.\r\n\r\n","author":{"url":"https://github.com/imankulov","@type":"Person","name":"imankulov"},"datePublished":"2020-06-10T07:58:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/432/hyper/issues/432"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:328f8088-26a4-a525-2154-2212f25fda9b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D9FC:258BE8:219F328:2C6A618:696B0D73 |
| html-safe-nonce | 130d8e91b8de5a6c42532a1150e8d8ceeea2ecfd89518be48e885b7181995bac |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOUZDOjI1OEJFODoyMTlGMzI4OjJDNkE2MTg6Njk2QjBENzMiLCJ2aXNpdG9yX2lkIjoiMTk3NjYwMjk1OTk0MzUwMzIxOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c2389dfb8d699d0463185284a6397a782080f5f2ed1784f8b17082d1f52aac45 |
| hovercard-subject-tag | issue:636022989 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-hyper/hyper/432/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9ddb6e33c9a7a722e919eee67490326f137574b036650ecc51249d47245dba3a/python-hyper/hyper/issues/432 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9ddb6e33c9a7a722e919eee67490326f137574b036650ecc51249d47245dba3a/python-hyper/hyper/issues/432 |
| og:image:alt | 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 exc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | imankulov |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python-hyper/hyper git https://github.com/python-hyper/hyper.git |
| octolytics-dimension-user_id | 13035907 |
| octolytics-dimension-user_login | python-hyper |
| octolytics-dimension-repository_id | 16165969 |
| octolytics-dimension-repository_nwo | python-hyper/hyper |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16165969 |
| octolytics-dimension-repository_network_root_nwo | python-hyper/hyper |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width