From 243d68c222acb914b5df3b1dea289110896b3e3e Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Fri, 17 May 2019 17:30:51 -0700 Subject: [PATCH 1/7] bpo-36952: remove bufsize keyword (deprecated 3.6, removed 3.8) This keyword is marked as deprecated since 3.6 and for removal in 3.8. It already had no effects. --- Doc/library/fileinput.rst | 10 ++-------- Doc/whatsnew/3.8.rst | 4 ++++ Lib/fileinput.py | 13 ++++--------- Lib/test/test_fileinput.py | 40 +++++++++++++++----------------------- 4 files changed, 26 insertions(+), 41 deletions(-) diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst index af9dff34a80827..8ef7a56df9619d 100644 --- a/Doc/library/fileinput.rst +++ b/Doc/library/fileinput.rst @@ -54,7 +54,7 @@ provided by this module. The following function is the primary interface of this module: -.. function:: input(files=None, inplace=False, backup='', bufsize=0, mode='r', openhook=None) +.. function:: input(files=None, inplace=False, backup='', mode='r', openhook=None) Create an instance of the :class:`FileInput` class. The instance will be used as global state for the functions of this module, and is also returned to use @@ -72,9 +72,6 @@ The following function is the primary interface of this module: .. versionchanged:: 3.2 Can be used as a context manager. - .. deprecated-removed:: 3.6 3.8 - The *bufsize* parameter. - The following functions use the global state created by :func:`fileinput.input`; if there is no active state, :exc:`RuntimeError` is raised. @@ -135,7 +132,7 @@ The class which implements the sequence behavior provided by the module is available for subclassing as well: -.. class:: FileInput(files=None, inplace=False, backup='', bufsize=0, mode='r', openhook=None) +.. class:: FileInput(files=None, inplace=False, backup='', mode='r', openhook=None) Class :class:`FileInput` is the implementation; its methods :meth:`filename`, :meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, :meth:`isfirstline`, @@ -166,9 +163,6 @@ available for subclassing as well: .. deprecated:: 3.4 The ``'rU'`` and ``'U'`` modes. - .. deprecated-removed:: 3.6 3.8 - The *bufsize* parameter. - .. deprecated:: 3.8 Support for :meth:`__getitem__` method is deprecated. diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index d47993bf1129f8..82fbef929bea47 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -821,6 +821,10 @@ The following features and APIs have been removed from Python 3.8: exposed to the user. (Contributed by Aviv Palivoda in :issue:`30262`.) +* The ``bufsize`` keyword argument of :func:`fileinput.input` and + :func:`fileinput.FileInput` which was ignored and deprecated since Python 3.6 + has been removed. :issue:`36952` + Porting to Python 3.8 ===================== diff --git a/Lib/fileinput.py b/Lib/fileinput.py index 0764aa5e4d2480..8e7928e4949a1d 100644 --- a/Lib/fileinput.py +++ b/Lib/fileinput.py @@ -80,8 +80,7 @@ _state = None -def input(files=None, inplace=False, backup="", bufsize=0, - mode="r", openhook=None): +def input(files=None, inplace=False, backup="", mode="r", openhook=None): """Return an instance of the FileInput class, which can be iterated. The parameters are passed to the constructor of the FileInput class. @@ -91,7 +90,7 @@ def input(files=None, inplace=False, backup="", bufsize=0, global _state if _state and _state._file: raise RuntimeError("input() already active") - _state = FileInput(files, inplace, backup, bufsize, mode, openhook) + _state = FileInput(files, inplace, backup, mode, openhook) return _state def close(): @@ -173,7 +172,7 @@ def isstdin(): return _state.isstdin() class FileInput: - """FileInput([files[, inplace[, backup[, bufsize, [, mode[, openhook]]]]]]) + """FileInput([files[, inplace[, backup[, mode[, openhook]]]]]) Class FileInput is the implementation of the module; its methods filename(), lineno(), fileline(), isfirstline(), isstdin(), fileno(), @@ -185,7 +184,7 @@ class FileInput: sequential order; random access and readline() cannot be mixed. """ - def __init__(self, files=None, inplace=False, backup="", bufsize=0, + def __init__(self, files=None, inplace=False, backup="", mode="r", openhook=None): if isinstance(files, str): files = (files,) @@ -201,10 +200,6 @@ def __init__(self, files=None, inplace=False, backup="", bufsize=0, self._files = files self._inplace = inplace self._backup = backup - if bufsize: - import warnings - warnings.warn('bufsize is deprecated and ignored', - DeprecationWarning, stacklevel=2) self._savestdout = None self._output = None self._filename = None diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py index 8b7577b0205cde..028c0ed34d790f 100644 --- a/Lib/test/test_fileinput.py +++ b/Lib/test/test_fileinput.py @@ -83,24 +83,20 @@ def close(self): class BufferSizesTests(BaseTests, unittest.TestCase): def test_buffer_sizes(self): # First, run the tests with default and teeny buffer size. - for round, bs in (0, 0), (1, 30): + for round in (0, 1): t1 = self.writeTmp(''.join("Line %s of file 1\n" % (i+1) for i in range(15))) t2 = self.writeTmp(''.join("Line %s of file 2\n" % (i+1) for i in range(10))) t3 = self.writeTmp(''.join("Line %s of file 3\n" % (i+1) for i in range(5))) t4 = self.writeTmp(''.join("Line %s of file 4\n" % (i+1) for i in range(1))) - if bs: - with self.assertWarns(DeprecationWarning): - self.buffer_size_test(t1, t2, t3, t4, bs, round) - else: - self.buffer_size_test(t1, t2, t3, t4, bs, round) + self.buffer_size_test(t1, t2, t3, t4, round) - def buffer_size_test(self, t1, t2, t3, t4, bs=0, round=0): + def buffer_size_test(self, t1, t2, t3, t4, round=0): pat = re.compile(r'LINE (\d+) OF FILE (\d+)') start = 1 + round*6 if verbose: - print('%s. Simple iteration (bs=%s)' % (start+0, bs)) - fi = FileInput(files=(t1, t2, t3, t4), bufsize=bs) + print('%s. Simple iteration' % (start+0)) + fi = FileInput(files=(t1, t2, t3, t4)) lines = list(fi) fi.close() self.assertEqual(len(lines), 31) @@ -110,8 +106,8 @@ def buffer_size_test(self, t1, t2, t3, t4, bs=0, round=0): self.assertEqual(fi.filename(), t4) if verbose: - print('%s. Status variables (bs=%s)' % (start+1, bs)) - fi = FileInput(files=(t1, t2, t3, t4), bufsize=bs) + print('%s. Status variables' % (start+1)) + fi = FileInput(files=(t1, t2, t3, t4)) s = "x" while s and s != 'Line 6 of file 2\n': s = fi.readline() @@ -122,15 +118,15 @@ def buffer_size_test(self, t1, t2, t3, t4, bs=0, round=0): self.assertFalse(fi.isstdin()) if verbose: - print('%s. Nextfile (bs=%s)' % (start+2, bs)) + print('%s. Nextfile' % (start+2)) fi.nextfile() self.assertEqual(fi.readline(), 'Line 1 of file 3\n') self.assertEqual(fi.lineno(), 22) fi.close() if verbose: - print('%s. Stdin (bs=%s)' % (start+3, bs)) - fi = FileInput(files=(t1, t2, t3, t4, '-'), bufsize=bs) + print('%s. Stdin' % (start+3)) + fi = FileInput(files=(t1, t2, t3, t4, '-')) savestdin = sys.stdin try: sys.stdin = StringIO("Line 1 of stdin\nLine 2 of stdin\n") @@ -143,8 +139,8 @@ def buffer_size_test(self, t1, t2, t3, t4, bs=0, round=0): sys.stdin = savestdin if verbose: - print('%s. Boundary conditions (bs=%s)' % (start+4, bs)) - fi = FileInput(files=(t1, t2, t3, t4), bufsize=bs) + print('%s. Boundary conditions' % (start+4)) + fi = FileInput(files=(t1, t2, t3, t4)) self.assertEqual(fi.lineno(), 0) self.assertEqual(fi.filename(), None) fi.nextfile() @@ -152,10 +148,10 @@ def buffer_size_test(self, t1, t2, t3, t4, bs=0, round=0): self.assertEqual(fi.filename(), None) if verbose: - print('%s. Inplace (bs=%s)' % (start+5, bs)) + print('%s. Inplace' % (start+5)) savestdout = sys.stdout try: - fi = FileInput(files=(t1, t2, t3, t4), inplace=1, bufsize=bs) + fi = FileInput(files=(t1, t2, t3, t4), inplace=1) for line in fi: line = line[:-1].upper() print(line) @@ -163,7 +159,7 @@ def buffer_size_test(self, t1, t2, t3, t4, bs=0, round=0): finally: sys.stdout = savestdout - fi = FileInput(files=(t1, t2, t3, t4), bufsize=bs) + fi = FileInput(files=(t1, t2, t3, t4)) for line in fi: self.assertEqual(line[-1], '\n') m = pat.match(line[:-1]) @@ -533,12 +529,11 @@ def test_pathlib_file_inplace(self): class MockFileInput: """A class that mocks out fileinput.FileInput for use during unit tests""" - def __init__(self, files=None, inplace=False, backup="", bufsize=0, + def __init__(self, files=None, inplace=False, backup="", mode="r", openhook=None): self.files = files self.inplace = inplace self.backup = backup - self.bufsize = bufsize self.mode = mode self.openhook = openhook self._file = None @@ -641,13 +636,11 @@ def do_test_call_input(self): files = object() inplace = object() backup = object() - bufsize = object() mode = object() openhook = object() # call fileinput.input() with different values for each argument result = fileinput.input(files=files, inplace=inplace, backup=backup, - bufsize=bufsize, mode=mode, openhook=openhook) # ensure fileinput._state was set to the returned object @@ -658,7 +651,6 @@ def do_test_call_input(self): self.assertIs(files, result.files, "files") self.assertIs(inplace, result.inplace, "inplace") self.assertIs(backup, result.backup, "backup") - self.assertIs(bufsize, result.bufsize, "bufsize") self.assertIs(mode, result.mode, "mode") self.assertIs(openhook, result.openhook, "openhook") From 2853aaabce123aa08b06e6e1f1445b8a65bcdc68 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Mon, 20 May 2019 09:03:16 -0700 Subject: [PATCH 2/7] Mention Contributor in whatsnew --- Doc/whatsnew/3.8.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index 82fbef929bea47..dd8c25d5bf043c 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -823,7 +823,7 @@ The following features and APIs have been removed from Python 3.8: * The ``bufsize`` keyword argument of :func:`fileinput.input` and :func:`fileinput.FileInput` which was ignored and deprecated since Python 3.6 - has been removed. :issue:`36952` + has been removed. :issue:`36952` (Contributed by Matthias Bussonnier) Porting to Python 3.8 From 1884bc1a0ee1c05d5fff4cc21149cd930b3d92e2 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Mon, 20 May 2019 09:03:31 -0700 Subject: [PATCH 3/7] make parameters kwonly --- Doc/library/fileinput.rst | 11 +++++++++-- Lib/fileinput.py | 8 ++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst index 8ef7a56df9619d..0b08d323a343c0 100644 --- a/Doc/library/fileinput.rst +++ b/Doc/library/fileinput.rst @@ -54,7 +54,7 @@ provided by this module. The following function is the primary interface of this module: -.. function:: input(files=None, inplace=False, backup='', mode='r', openhook=None) +.. function:: input(files=None, inplace=False, backup='', *, mode='r', openhook=None) Create an instance of the :class:`FileInput` class. The instance will be used as global state for the functions of this module, and is also returned to use @@ -69,6 +69,9 @@ The following function is the primary interface of this module: for line in f: process(line) + .. versionchanged:: 3.8 + The keyword parameter *mode* and *openhook* are now keyword-only. + .. versionchanged:: 3.2 Can be used as a context manager. @@ -132,7 +135,7 @@ The class which implements the sequence behavior provided by the module is available for subclassing as well: -.. class:: FileInput(files=None, inplace=False, backup='', mode='r', openhook=None) +.. class:: FileInput(files=None, inplace=False, backup='', *, mode='r', openhook=None) Class :class:`FileInput` is the implementation; its methods :meth:`filename`, :meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, :meth:`isfirstline`, @@ -157,6 +160,10 @@ available for subclassing as well: with FileInput(files=('spam.txt', 'eggs.txt')) as input: process(input) + + .. versionchanged:: 3.8 + The keyword parameter *mode* and *openhook* are now keyword-only. + .. versionchanged:: 3.2 Can be used as a context manager. diff --git a/Lib/fileinput.py b/Lib/fileinput.py index 8e7928e4949a1d..d868e74cd5e969 100644 --- a/Lib/fileinput.py +++ b/Lib/fileinput.py @@ -80,7 +80,7 @@ _state = None -def input(files=None, inplace=False, backup="", mode="r", openhook=None): +def input(files=None, inplace=False, backup="", *, mode="r", openhook=None): """Return an instance of the FileInput class, which can be iterated. The parameters are passed to the constructor of the FileInput class. @@ -90,7 +90,7 @@ def input(files=None, inplace=False, backup="", mode="r", openhook=None): global _state if _state and _state._file: raise RuntimeError("input() already active") - _state = FileInput(files, inplace, backup, mode, openhook) + _state = FileInput(files, inplace, backup, mode=mode, openhook=openhook) return _state def close(): @@ -172,7 +172,7 @@ def isstdin(): return _state.isstdin() class FileInput: - """FileInput([files[, inplace[, backup[, mode[, openhook]]]]]) + """FileInput([files[, inplace[, backup]]], *, mode=None, openhook=None) Class FileInput is the implementation of the module; its methods filename(), lineno(), fileline(), isfirstline(), isstdin(), fileno(), @@ -184,7 +184,7 @@ class FileInput: sequential order; random access and readline() cannot be mixed. """ - def __init__(self, files=None, inplace=False, backup="", + def __init__(self, files=None, inplace=False, backup="", *, mode="r", openhook=None): if isinstance(files, str): files = (files,) From 57f4a5583a95daf33bf050bd2362513c1212d49d Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Mon, 20 May 2019 09:08:58 -0700 Subject: [PATCH 4/7] Simplify tests to reflect new removed parameter Have mock follow same API with kwonly params --- Lib/test/test_fileinput.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py index 028c0ed34d790f..888fcedbd9f027 100644 --- a/Lib/test/test_fileinput.py +++ b/Lib/test/test_fileinput.py @@ -82,18 +82,15 @@ def close(self): class BufferSizesTests(BaseTests, unittest.TestCase): def test_buffer_sizes(self): - # First, run the tests with default and teeny buffer size. - for round in (0, 1): - t1 = self.writeTmp(''.join("Line %s of file 1\n" % (i+1) for i in range(15))) - t2 = self.writeTmp(''.join("Line %s of file 2\n" % (i+1) for i in range(10))) - t3 = self.writeTmp(''.join("Line %s of file 3\n" % (i+1) for i in range(5))) - t4 = self.writeTmp(''.join("Line %s of file 4\n" % (i+1) for i in range(1))) - self.buffer_size_test(t1, t2, t3, t4, round) - - def buffer_size_test(self, t1, t2, t3, t4, round=0): + + t1 = self.writeTmp(''.join("Line %s of file 1\n" % (i+1) for i in range(15))) + t2 = self.writeTmp(''.join("Line %s of file 2\n" % (i+1) for i in range(10))) + t3 = self.writeTmp(''.join("Line %s of file 3\n" % (i+1) for i in range(5))) + t4 = self.writeTmp(''.join("Line %s of file 4\n" % (i+1) for i in range(1))) + pat = re.compile(r'LINE (\d+) OF FILE (\d+)') - start = 1 + round*6 + start = 1 if verbose: print('%s. Simple iteration' % (start+0)) fi = FileInput(files=(t1, t2, t3, t4)) @@ -116,7 +113,7 @@ def buffer_size_test(self, t1, t2, t3, t4, round=0): self.assertEqual(fi.filelineno(), 6) self.assertFalse(fi.isfirstline()) self.assertFalse(fi.isstdin()) - + if verbose: print('%s. Nextfile' % (start+2)) fi.nextfile() @@ -529,7 +526,7 @@ def test_pathlib_file_inplace(self): class MockFileInput: """A class that mocks out fileinput.FileInput for use during unit tests""" - def __init__(self, files=None, inplace=False, backup="", + def __init__(self, files=None, inplace=False, backup="", *, mode="r", openhook=None): self.files = files self.inplace = inplace From beafa193ccb76bfcfa090777e2ba9c68f0c98eeb Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Mon, 20 May 2019 09:21:57 -0700 Subject: [PATCH 5/7] fix whitespaces --- Doc/library/fileinput.rst | 2 +- Lib/test/test_fileinput.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst index 0b08d323a343c0..6946512c7b1f0c 100644 --- a/Doc/library/fileinput.rst +++ b/Doc/library/fileinput.rst @@ -71,7 +71,7 @@ The following function is the primary interface of this module: .. versionchanged:: 3.8 The keyword parameter *mode* and *openhook* are now keyword-only. - + .. versionchanged:: 3.2 Can be used as a context manager. diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py index 888fcedbd9f027..69b8acdfd7e8f7 100644 --- a/Lib/test/test_fileinput.py +++ b/Lib/test/test_fileinput.py @@ -82,7 +82,7 @@ def close(self): class BufferSizesTests(BaseTests, unittest.TestCase): def test_buffer_sizes(self): - + t1 = self.writeTmp(''.join("Line %s of file 1\n" % (i+1) for i in range(15))) t2 = self.writeTmp(''.join("Line %s of file 2\n" % (i+1) for i in range(10))) t3 = self.writeTmp(''.join("Line %s of file 3\n" % (i+1) for i in range(5))) @@ -113,7 +113,7 @@ def test_buffer_sizes(self): self.assertEqual(fi.filelineno(), 6) self.assertFalse(fi.isfirstline()) self.assertFalse(fi.isstdin()) - + if verbose: print('%s. Nextfile' % (start+2)) fi.nextfile() From f83aa1a7574e287574ec72c2ed4745ee0b9591a5 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Mon, 20 May 2019 09:26:39 -0700 Subject: [PATCH 6/7] plural --- Doc/library/fileinput.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst index 6946512c7b1f0c..cfa46a8d182ec2 100644 --- a/Doc/library/fileinput.rst +++ b/Doc/library/fileinput.rst @@ -70,7 +70,7 @@ The following function is the primary interface of this module: process(line) .. versionchanged:: 3.8 - The keyword parameter *mode* and *openhook* are now keyword-only. + The keyword parameters *mode* and *openhook* are now keyword-only. .. versionchanged:: 3.2 Can be used as a context manager. From eda634b60a656cd9a0391d3b36ee1eb5093c4e73 Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Mon, 20 May 2019 11:05:57 -0700 Subject: [PATCH 7/7] Take into account some of the review comments --- Doc/library/fileinput.rst | 12 +++++++----- Lib/test/test_fileinput.py | 13 ++++++------- .../2019-05-20-11-01-28.bpo-36952.MgZi7-.rst | 4 ++++ 3 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2019-05-20-11-01-28.bpo-36952.MgZi7-.rst diff --git a/Doc/library/fileinput.rst b/Doc/library/fileinput.rst index cfa46a8d182ec2..14be492f55a67f 100644 --- a/Doc/library/fileinput.rst +++ b/Doc/library/fileinput.rst @@ -69,11 +69,12 @@ The following function is the primary interface of this module: for line in f: process(line) + .. versionchanged:: 3.2 + Can be used as a context manager. + .. versionchanged:: 3.8 The keyword parameters *mode* and *openhook* are now keyword-only. - .. versionchanged:: 3.2 - Can be used as a context manager. The following functions use the global state created by :func:`fileinput.input`; if there is no active state, :exc:`RuntimeError` is raised. @@ -161,9 +162,6 @@ available for subclassing as well: process(input) - .. versionchanged:: 3.8 - The keyword parameter *mode* and *openhook* are now keyword-only. - .. versionchanged:: 3.2 Can be used as a context manager. @@ -173,6 +171,10 @@ available for subclassing as well: .. deprecated:: 3.8 Support for :meth:`__getitem__` method is deprecated. + .. versionchanged:: 3.8 + The keyword parameter *mode* and *openhook* are now keyword-only. + + **Optional in-place filtering:** if the keyword argument ``inplace=True`` is passed to :func:`fileinput.input` or to the :class:`FileInput` constructor, the diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py index 69b8acdfd7e8f7..014f19e6cbdb1a 100644 --- a/Lib/test/test_fileinput.py +++ b/Lib/test/test_fileinput.py @@ -90,9 +90,8 @@ def test_buffer_sizes(self): pat = re.compile(r'LINE (\d+) OF FILE (\d+)') - start = 1 if verbose: - print('%s. Simple iteration' % (start+0)) + print('1. Simple iteration') fi = FileInput(files=(t1, t2, t3, t4)) lines = list(fi) fi.close() @@ -103,7 +102,7 @@ def test_buffer_sizes(self): self.assertEqual(fi.filename(), t4) if verbose: - print('%s. Status variables' % (start+1)) + print('2. Status variables') fi = FileInput(files=(t1, t2, t3, t4)) s = "x" while s and s != 'Line 6 of file 2\n': @@ -115,14 +114,14 @@ def test_buffer_sizes(self): self.assertFalse(fi.isstdin()) if verbose: - print('%s. Nextfile' % (start+2)) + print('3. Nextfile') fi.nextfile() self.assertEqual(fi.readline(), 'Line 1 of file 3\n') self.assertEqual(fi.lineno(), 22) fi.close() if verbose: - print('%s. Stdin' % (start+3)) + print('4. Stdin') fi = FileInput(files=(t1, t2, t3, t4, '-')) savestdin = sys.stdin try: @@ -136,7 +135,7 @@ def test_buffer_sizes(self): sys.stdin = savestdin if verbose: - print('%s. Boundary conditions' % (start+4)) + print('5. Boundary conditions') fi = FileInput(files=(t1, t2, t3, t4)) self.assertEqual(fi.lineno(), 0) self.assertEqual(fi.filename(), None) @@ -145,7 +144,7 @@ def test_buffer_sizes(self): self.assertEqual(fi.filename(), None) if verbose: - print('%s. Inplace' % (start+5)) + print('6. Inplace') savestdout = sys.stdout try: fi = FileInput(files=(t1, t2, t3, t4), inplace=1) diff --git a/Misc/NEWS.d/next/Library/2019-05-20-11-01-28.bpo-36952.MgZi7-.rst b/Misc/NEWS.d/next/Library/2019-05-20-11-01-28.bpo-36952.MgZi7-.rst new file mode 100644 index 00000000000000..f5ce2aadf4a18c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-05-20-11-01-28.bpo-36952.MgZi7-.rst @@ -0,0 +1,4 @@ +:func:`fileinput.input` and :class:`fileinput.FileInput` **bufsize** +argument has been removed (was deprecated and ignored since Python 3.6), +and as a result the **mode** and **openhook** arguments have been made +keyword-only.