8000 gh-101936: Update the default value of fp from io.StringIO to io.BytesIO by longvhdeveloper · Pull Request #102100 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-101936: Update the default value of fp from io.StringIO to io.BytesIO #102100

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

Merged
merged 7 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10000
Prev Previous commit
Next Next commit
update unit test
  • Loading branch information
longvhdeveloper committed Feb 21, 2023
commit 35530299d4b9fa8cec46eddd0e7367566a47ae32
1 change: 1 addition & 0 deletions Lib/test/test_urllib2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1827,6 +1827,7 @@ def test_HTTPError_interface(self):
def test_gh_98778(self):
x = urllib.error.HTTPError("url", 405, "METHOD NOT ALLOWED", None, None)
self.assertEqual(getattr(x, "__notes__", ()), ())
self.assertEqual(isinstance(x.fp.read(), bytes), True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.assertEqual(isinstance(x.fp.read(), bytes), True)
self.assertIsInstance(x.fp.read(), bytes)


def test_parse_proxy(self):
parse_proxy_test_cases = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The default value of fp becomes :class:io.BytesIO if
:exc:~urllib.error.HTTPError is initialized without a designated fp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The default value of fp becomes :class:io.BytesIO if
:exc:~urllib.error.HTTPError is initialized without a designated fp
The default value of fp becomes :class:`io.BytesIO` if
:exc:`~urllib.error.HTTPError` is initialized without a designated ``fp``

parameter. Patch by Long Vo
0