Title: tests fail under python3.9: urllib.parse.unquote accepts bytes · Issue #541 · PythonCharmers/python-future · GitHub
Open Graph Title: tests fail under python3.9: urllib.parse.unquote accepts bytes · Issue #541 · PythonCharmers/python-future
X Title: tests fail under python3.9: urllib.parse.unquote accepts bytes · Issue #541 · PythonCharmers/python-future
Description: ________________________ UnquotingTests.test_unquoting _________________________ self =
Open Graph Description: ________________________ UnquotingTests.test_unquoting _________________________ self =
X Description: ________________________ UnquotingTests.test_unquoting _________________________ self = <test_future.test_urllib_toplevel.UnquotingTests testMethod=test_unquoting> def test_unquoting(self): #...
Opengraph URL: https://github.com/PythonCharmers/python-future/issues/541
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"tests fail under python3.9: urllib.parse.unquote accepts bytes","articleBody":"```\r\n________________________ UnquotingTests.test_unquoting _________________________\r\n\r\nself = \u003ctest_future.test_urllib_toplevel.UnquotingTests testMethod=test_unquoting\u003e\r\n\r\n def test_unquoting(self):\r\n # Make sure unquoting of all ASCII values works\r\n escape_list = []\r\n for num in range(128):\r\n given = hexescape(chr(num))\r\n expect = chr(num)\r\n result = urllib_parse.unquote(given)\r\n self.assertEqual(expect, result,\r\n \"using unquote(): %r != %r\" % (expect, result))\r\n result = urllib_parse.unquote_plus(given)\r\n self.assertEqual(expect, result,\r\n \"using unquote_plus(): %r != %r\" %\r\n (expect, result))\r\n escape_list.append(given)\r\n escape_string = ''.join(escape_list)\r\n del escape_list\r\n result = urllib_parse.unquote(escape_string)\r\n self.assertEqual(result.count('%'), 1,\r\n \"using unquote(): not all characters escaped: \"\r\n \"%s\" % result)\r\n self.assertRaises((TypeError, AttributeError), urllib_parse.unquote, None)\r\n self.assertRaises((TypeError, AttributeError), urllib_parse.unquote, ())\r\n with support.check_warnings(('', BytesWarning), quiet=True):\r\n\u003e self.assertRaises((TypeError, AttributeError), urllib_parse.unquote, bytes(b''))\r\nE AssertionError: (\u003cclass 'TypeError'\u003e, \u003cclass 'AttributeError'\u003e) not raised by unquote\r\n\r\ntests/test_future/test_urllib_toplevel.py:785: AssertionError\r\n```\r\n\r\npython3.8:\r\n```pycon\r\n\u003e\u003e\u003e import urllib.parse\r\n\u003e\u003e\u003e urllib.parse.unquote(b'')\r\nTraceback (most recent call last):\r\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n File \"/usr/lib64/python3.7/urllib/parse.py\", line 609, in unquote\r\n if '%' not in string:\r\nTypeError: a bytes-like object is required, not 'str'\r\n```\r\n\r\npython3.9:\r\n```pycon\r\n\u003e\u003e\u003e import urllib.parse\r\n\u003e\u003e\u003e urllib.parse.unquote(b'')\r\n''\r\n```\r\n","author":{"url":"https://github.com/keszybz","@type":"Person","name":"keszybz"},"datePublished":"2020-02-03T21:47:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/541/python-future/issues/541"}
| 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:733ec317-a74c-0fc8-8583-3df81fd295a5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DC18:1071AE:106603A:15F58A1:6A5AA421 |
| html-safe-nonce | a7f6d824a1f436cc3f83b637c515cb0f875dc9d2e8d981cfff9365d370ec2dd3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzE4OjEwNzFBRToxMDY2MDNBOjE1RjU4QTE6NkE1QUE0MjEiLCJ2aXNpdG9yX2lkIjoiNDA1NTY0MTU2Njc0ODUxNzQwOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6901a1b2ba26241da26ace05ea7495c0377b00c25ff802b58a2a14ae959eb41f |
| hovercard-subject-tag | issue:559354357 |
| 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/PythonCharmers/python-future/541/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7aeb9db8624b4055cd8dca756c39f1043f493fa45ea552d3a63e4dca0cba4f77/PythonCharmers/python-future/issues/541 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7aeb9db8624b4055cd8dca756c39f1043f493fa45ea552d3a63e4dca0cba4f77/PythonCharmers/python-future/issues/541 |
| og:image:alt | ________________________ UnquotingTests.test_unquoting _________________________ self = |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | keszybz |
| hostname | github.com |
| expected-hostname | github.com |
| None | 17a57ee6ab03686731c491fccb57e6a97c066a29d7cdf1a7d83c46f5c56684fc |
| turbo-cache-control | no-preview |
| go-import | github.com/PythonCharmers/python-future git https://github.com/PythonCharmers/python-future.git |
| octolytics-dimension-user_id | 3365815 |
| octolytics-dimension-user_login | PythonCharmers |
| octolytics-dimension-repository_id | 11403699 |
| octolytics-dimension-repository_nwo | PythonCharmers/python-future |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 11403699 |
| octolytics-dimension-repository_network_root_nwo | PythonCharmers/python-future |
| 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 | 5cb870aa6b86b87be75e23ca7caec54726a25af9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width