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
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: Lib/test/test_urllib2.py +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1826,6 +1826,7 @@ def test_HTTPError_interface(self): |
1826 | 1826 | def test_gh_98778(self): |
1827 | 1827 | x = urllib.error.HTTPError("url", 405, "METHOD NOT ALLOWED", None, None) |
1828 | 1828 | self.assertEqual(getattr(x, "__notes__", ()), ()) |
| 1829 | + self.assertIsInstance(x.fp.read(), bytes) |
1829 | 1830 |
|
1830 | 1831 | def test_parse_proxy(self): |
1831 | 1832 | parse_proxy_test_cases = [ |
|
Collapse file
Copy file name to clipboardExpand all lines: Lib/urllib/error.py +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -43,7 +43,7 @@ def __init__(self, url, code, msg, hdrs, fp): |
43 | 43 | self.fp = fp |
44 | 44 | self.filename = url |
45 | 45 | if fp is None: |
46 | | - fp = io.StringIO() |
| 46 | + fp = io.BytesIO() |
47 | 47 | self.__super_init(fp, hdrs, url, code) |
48 | 48 |
|
49 | 49 | def __str__(self): |
|
Collapse file
Copy file name to clipboardExpand all lines: Misc/ACKS +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1867,6 +1867,7 @@ Kurt Vile |
1867 | 1867 | Norman Vine |
1868 | 1868 | Pauli Virtanen |
1869 | 1869 | Frank Visser |
| 1870 | +Long Vo |
1870 | 1871 | Johannes Vogel |
1871 | 1872 | Michael Vogt |
1872 | 1873 | Radu Voicilas |
|
Collapse file
Copy file name to clipboard +2Lines changed: 2 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
|
| 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. |