Serhiy Storchaka
2602d8ae98
gh-71339: Use new assertion methods in tests (GH-129046)
2025-05-22 13:17:22 +03:00
Serhiy Storchaka
0152dc4ff5
gh-119064: Use os_helper.FakePath instead of pathlib.Path in tests (GH-119065)
2024-05-16 10:25:10 +03:00
Ville Skyttä
a768e12f09
Use bool in fileinput.input() docstring and tests for the inplace argument (GH-111998)
...
The `.rst` docs, most tests, and typeshed already use bool for it.
2024-01-27 23:47:55 +02:00
Gihwan Kim
6f25657b83
gh-101961 fileinput.hookcompressed should not set the encoding value for the binary mode (gh-102068)
2023-02-21 12:10:29 +09:00
Inada Naoki
5c7f3bcdaf
gh-93157: Fix fileinput didn't support errors
in inplace
mode (GH-95128)
2022-07-24 11:42:11 +09:00
Hugo van Kemenade
d003a5bd25
bpo-45132 Remove deprecated __getitem__ methods (GH-28225)
...
Remove deprecated __getitem__ methods of xml.dom.pulldom.DOMEventStream,
wsgiref.util.FileWrapper and fileinput.FileInput, deprecated since Python 3.9.
2021-09-08 13:07:40 +03:00
Victor Stinner
19ba2122ac
bpo-37330: open() no longer accept 'U' in file mode (GH-28118)
...
open(), io.open(), codecs.open() and fileinput.FileInput no longer
accept "U" ("universal newline") in the file mode. This flag was
deprecated since Python 3.3.
2021-09-02 12:58:00 +02:00
Inada Naoki
878bc8b6c2
bpo-43651: Fix EncodingWarning in fileinput and its test (GH-25648)
2021-04-27 15:47:16 +09:00
Inada Naoki
333d10cbb5
bpo-43712 : fileinput: Add encoding parameter (GH-25272)
2021-04-14 14:12:58 +09:00
Hai Shi
847f94f47b
bpo-40275: Use new test.support helper submodules in tests (GH-21151)
...
Use new test.support helper submodules in tests:
* distutils tests
* test_buffer
* test_compile
* test_filecmp
* test_fileinput
* test_readline
* test_smtpnet
* test_structmembers
* test_tools
2020-06-25 19:17:57 +02:00
Victor Stinner
942f7a2dea
bpo-39674: Revert "bpo-37330: open() no longer accept 'U' in file mode (GH-16959)" (GH-18767)
...
This reverts commit e471e72977
.
The mode will be removed from Python 3.10.
2020-03-04 18:50:22 +01:00
Victor Stinner
e471e72977
bpo-37330: open() no longer accept 'U' in file mode (GH-16959)
...
open(), io.open(), codecs.open() and fileinput.FileInput no longer
accept "U" ("universal newline") in the file mode. This flag was
deprecated since Python 3.3.
2019-10-28 15:40:08 +01:00
Matthias Bussonnier
1a3faf9d97
bpo-36952: Remove the bufsize parameter in fileinput.input(). (GH-13400)
...
This parameter is marked as deprecated since 3.6 and for removal in 3.8.
It already had no effects.
2019-05-20 23:44:11 +03:00
Berker Peksag
be6dbfb43b
bpo-1613500: Don't hardcode output file mode in fileinput.FileInput (GH-12986)
2019-04-29 17:55:39 +03:00
Anthony Sottile
8377cd4fcd
Clean up code which checked presence of os.{stat,lstat,chmod} ( #11643 )
2019-02-25 23:32:27 +01:00
Berker Peksag
84a13fbda0
bpo-9372: Deprecate several __getitem__ methods (GH-8609)
...
The __getitem__ methods of DOMEventStream, FileInput,
and FileWrapper classes ignore their 'index' parameters
and return the next item instead.
2018-08-11 09:05:04 +03:00
Serhiy Storchaka
5f48e2644d
bpo-33753: Refactor creating temporary files in test_fileinput. (GH-7377)
2018-06-05 12:08:36 +03:00
Zhiming Wang
06de1aeff9
bpo-31281: Fix pathlib.Path incompatibility in fileinput (gh-3208)
...
Fix fileinput with inplace=True to accept pathlib.Path objects.
2017-09-04 13:37:24 -04:00
Roy Williams
002665a9da
bpo-30432: FileInput doesn't accept PathLike objects for file names ( #1732 )
...
* Allow FileInput to accept a single PathLike object as a parameter for `files`
Fixes
bpo-30432: FileInput doesn't accept PathLike objects for file names
* Address comments from @ambv
2017-05-22 22:24:17 -07:00
Serhiy Storchaka
b275210a3b
Issue #25788 : fileinput.hook_encoded() now supports an "errors" argument
...
for passing to open. Original patch by Joseph Hackman.
2016-04-27 23:13:46 +03:00
Serhiy Storchaka
597d15afe4
Issue #23277 : Remove unused support.run_unittest import.
2016-04-24 13:45:58 +03:00
Serhiy Storchaka
674e2d0ea0
Issue #15068 : Got rid of excessive buffering in fileinput.
...
The bufsize parameter is now deprecated and ignored.
2016-03-08 18:35:19 +02:00
Serhiy Storchaka
cc2dbc5844
Issue #15068 : Got rid of excessive buffering in the fileinput module.
...
The bufsize parameter is no longer used.
2016-03-08 18:28:36 +02:00
Martin Panter
7978e10441
Issue #23883 : Missing fileinput.__all__ APIs; patch by Mauro SM Rodrigues
2016-01-16 06:26:54 +00:00
R David Murray
830207e8f3
#22709 : Use stdin as-is if it does not have a buffer attribute.
...
This restores backward compatibility lost in the fix for #21075 , and
is better duck typing.
Patch by Akira Li.
2016-01-02 15:41:41 -05:00
Serhiy Storchaka
314464d0ab
Issue #25510 : fileinput.FileInput.readline() now returns b'' instead of ''
...
at the end if the FileInput was opened with binary mode.
Patch by Ryosuke Ito.
2015-11-01 16:43:58 +02:00
Serhiy Storchaka
946cfc3e23
Issue #21075 : fileinput.FileInput now reads bytes from standard stream if
...
binary mode is specified. Patch by Sam Kimbrel.
2014-05-14 21:08:33 +03:00
Serhiy Storchaka
cd9028ca69
Correct comments and improve failure reports in test_fileinput ( closes #20501 ).
...
Thanks Vajrasky Kok and Zachary Ware.
2014-03-03 21:19:19 +02:00
Serhiy Storchaka
682ea5f70e
Correct comments and improve failure reports in test_fileinput ( closes #20501 ).
...
Thanks Vajrasky Kok and Zachary Ware.
2014-03-03 21:17:17 +02:00
Serhiy Storchaka
517b74734a
Added tests for issue #20501 .
2014-02-26 20:59:43 +02:00
Serhiy Storchaka
9fff849dbf
Added tests for issue #20501 .
2014-02-26 21:03:19 +02:00
Serhiy Storchaka
2480c2ed59
Issue #15204 : Silence and check the 'U' mode deprecation warnings in tests.
...
Changed deprecation message in the fileinput module.
2013-11-24 23:13:26 +02:00
Brett Cannon
3e9a9ae09d
Update various test modules to use unittest.main() for test discovery
...
instead of manually listing tests for test.support.run_unittest().
2013-06-12 21:25:59 -04:00
Andrew Svetlov
f7a17b48d7
Replace IOError with OSError ( #16715 )
2012-12-25 16:47:37 +02:00
Florent Xicluna
a011e2b2fa
fileinput: replace this last occurence of codecs.open with builtins.open.
2011-11-07 19:43:07 +01:00
Ezio Melotti
c3afbb9542
Skip test in test_fileinput when zlib is missing.
2011-05-14 10:10:53 +03:00
briancurtin
f84f3c3d2d
Fix #11596 . When bz2 isn't available, skip test_bz2_ext_fake.
2011-03-18 13:03:17 -05:00
Brett Cannon
d47af53126
Move off of assertEquals() and over to assertEqual().
2011-03-15 15:55:12 -04:00
briancurtin
5eb3591a41
Adjust test names to be more descriptive instead of depending on capitalization.
2011-03-15 10:59:36 -04:00
Benjamin Peterson
eb46288a8d
import style nits
2011-03-15 09:50:18 -05:00
briancurtin
906f0c45fd
Fix #11509 . Significantly increase test coverage for fileinput.
...
Patch by Denver Coneybeare at the PyCon 2011 Sprints.
2011-03-15 10:29:41 -04:00
Georg Brandl
6cb7b6593e
#1286 : allow using fileinput.FileInput as context manager.
2010-07-31 20:08:15 +00:00
Benjamin Peterson
c9c0f201fe
convert old fail* assertions to assert*
2009-06-30 23:06:06 +00:00
Benjamin Peterson
ee8712cda4
#2621 rename test.test_support to test.support
2008-05-20 21:35:26 +00:00
Neal Norwitz
2595e7606c
Ensure cleanup does not reference variables that don't yet exist.
2008-03-24 06:10:13 +00:00
Christian Heimes
05e8be17fd
Merged revisions 60990-61002 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/python/trunk
........
r60990 | eric.smith | 2008-02-23 17:05:26 +0100 (Sat, 23 Feb 2008) | 1 line
Removed duplicate Py_CHARMASK define. It's already defined in Python.h.
........
r60991 | andrew.kuchling | 2008-02-23 17:23:05 +0100 (Sat, 23 Feb 2008) | 4 lines
#1330538 : Improve comparison of xmlrpclib.DateTime and datetime instances.
Remove automatic handling of datetime.date and datetime.time.
This breaks backward compatibility, but python-dev discussion was strongly
against this automatic conversion; see the bug for a link.
........
r60994 | andrew.kuchling | 2008-02-23 17:39:43 +0100 (Sat, 23 Feb 2008) | 1 line
#835521 : Add index entries for various pickle-protocol methods and attributes
........
r60995 | andrew.kuchling | 2008-02-23 18:10:46 +0100 (Sat, 23 Feb 2008) | 2 lines
#1433694 : minidom's .normalize() failed to set .nextSibling for last element.
Fix by Malte Helmert
........
r61000 | christian.heimes | 2008-02-23 18:40:11 +0100 (Sat, 23 Feb 2008) | 1 line
Patch #2167 from calvin: Remove unused imports
........
r61001 | christian.heimes | 2008-02-23 18:42:31 +0100 (Sat, 23 Feb 2008) | 1 line
Patch #1957 : syslogmodule: Release GIL when calling syslog(3)
........
r61002 | christian.heimes | 2008-02-23 18:52:07 +0100 (Sat, 23 Feb 2008) | 2 lines
Issue #2051 and patch from Alexander Belopolsky:
Permission for pyc and pyo files are inherited from the py file.
........
2008-02-23 18:30:17 +00:00
Guido van Rossum
e22905a06c
More changes needed to make things work once bytes and str are truly divorced.
2007-08-27 23:09:25 +00:00
Guido van Rossum
34d1928766
SF patch# 1770008 by Christian Heimes (plus some extras).
...
Completely get rid of StringIO.py and cStringIO.c.
I had to fix a few tests and modules beyond what Christian did, and
invent a few conventions. E.g. in elementtree, I chose to
write/return Unicode strings whe no encoding is given, but bytes when
an explicit encoding is given. Also mimetools was made to always
assume binary files.
2007-08-09 01:03:29 +00:00
Guido van Rossum
c43e79f3c8
Fix a buch of shallow test failures.
...
Note: in test_fileinput.py, two tests are disabled until I figure out how
to replace these.
2007-06-18 18:26:36 +00:00
Guido van Rossum
ef87d6ed94
Rip out all the u"..." literals and calls to unicode().
2007-05-02 19:09:54 +00:00