Commit Graph

66 Commits

Author SHA1 Message Date
Jack Jansen 52941a8348 Test that chmod() actually exists before calling it (it doesn't on MacOS9). 2003-01-08 16:33:16 +00:00
Skip Montanaro cffac66393 tightening up a few except: clauses
see bug 411881
2002-08-14 02:58:16 +00:00
Walter Dörwald 294bbf3a59 Replace obsolete stat module constants with
equivalent attributes in a few more spots.

This closes SF patch http://www.python.org/sf/562373
2002-06-06 09:48:13 +00:00
Tim Peters 8ac1495a6a Whitespace normalization. 2002-05-23 15:15:30 +00:00
Raymond Hettinger d1fa3db52d Added docstrings excerpted from Python Library Reference.
Closes patch 556161.
2002-05-15 02:56:03 +00:00
Tim Peters 863ac44b74 Whitespace normalization. 2002-04-16 01:38:40 +00:00
Guido van Rossum 8ca162f417 Partial introduction of bools where appropriate. 2002-04-07 06:36:23 +00:00
Neil Schemenauer 908632a6a6 Implement iterator protocol. 2002-03-26 20:28:40 +00:00
Guido van Rossum e2ae77b8b8 SF patch #474590 -- RISC OS support 2001-10-24 20:42:55 +00:00
Skip Montanaro eccd02a40d more __all__ updates 2001-01-20 23:34:12 +00:00
Guido van Rossum 4795524101 Speed it up by using readlines(sizehint). It's still slower than
other ways of reading input. :-(

In the process, I added an optional bufsize argument to the input()
function and the FileInput class.
2001-01-05 14:44:39 +00:00
Guido van Rossum 2516b39dd3 Implement suggestion from Lawrence Kesteloot in PR#280, to change the
default list of files from () to None, and explicitly test for None
before defaulting to sys.argv[1:].  This means that if you pass in an
explicit empty list, it will read stdin instead of defaulting to
sys.argv[1:].  This fixes a buglet in the test script (when called
with options but without files, it chokes when it tries to interpret
the options as files).

Lawrence adds: "I suspect that this is a safe change, because I can't
imagine someone actively passing in an empty list when they want
sys.argv used."

I agree.
2000-04-10 17:16:12 +00:00
Guido van Rossum dcb8583c18 Fix for PR#111: when using the inplace option, give the new file the
same permissions as the old file, plugging a security hole.
(Not using exactly the suggested bugfix.)
1999-10-18 21:41:43 +00:00
Guido van Rossum 0aec9fb183 Add missing initializer for self._backupfilename. Due to Ralph Butler. 1998-07-20 15:49:28 +00:00
Guido van Rossum 45e2fbc2e7 Mass check-in after untabifying all files that need it. 1998-03-26 21:13:24 +00:00
Guido van Rossum 7d5b99d8bf A new standard module, as discussed on comp.lang.python, to simplify
the writing of filters.

Typical use is:

    import fileinput
    for line in fileinput.input():
        process(line)

This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty or when a filename is
'-'.

There is also an option to use this to direct the output back to the
input files.
1997-11-21 17:12:59 +00:00