GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [3.10] gh-101936: Update the default value of fp from io.StringIO to … · python/cpython@0f28af5

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Lib
    • test
      • test_urllib2.py
    • urllib
      • error.py
  • Misc
    • ACKS
    • NEWS.d/next/Library
      • 2023-02-21-07-15-41.gh-issue-101936.QVOxHH.rst
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Lib/test/test_urllib2.py‎

Copy file name to clipboardExpand all lines: Lib/test/test_urllib2.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,6 +1826,7 @@ def test_HTTPError_interface(self):
18261826
def test_gh_98778(self):
18271827
x = urllib.error.HTTPError("url", 405, "METHOD NOT ALLOWED", None, None)
18281828
self.assertEqual(getattr(x, "__notes__", ()), ())
1829+
self.assertIsInstance(x.fp.read(), bytes)
18291830

18301831
def test_parse_proxy(self):
18311832
parse_proxy_test_cases = [
Collapse file

‎Lib/urllib/error.py‎

Copy file name to clipboardExpand all lines: Lib/urllib/error.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(self, url, code, msg, hdrs, fp):
4343
self.fp = fp
4444
self.filename = url
4545
if fp is None:
46-
fp = io.StringIO()
46+
fp = io.BytesIO()
4747
self.__super_init(fp, hdrs, url, code)
4848

4949
def __str__(self):
Collapse file

‎Misc/ACKS‎

Copy file name to clipboardExpand all lines: Misc/ACKS
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,6 +1867,7 @@ Kurt Vile
18671867
Norman Vine
18681868
Pauli Virtanen
18691869
Frank Visser
1870+
Long Vo
18701871
Johannes Vogel
18711872
Michael Vogt
18721873
Radu Voicilas
Collapse file

‎Misc/NEWS.d/next/Library/2023-02-21-07-15-41.gh-issue-101936.QVOxHH.rst‎

Copy file name to clipboard
+2Lines changed: 2 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
The default value of ``fp`` becomes :class:`io.BytesIO` if :exc:`~urllib.error.HTTPError`
2+
is initialized without a designated ``fp`` parameter. Patch by Long Vo.

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.