summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_file.py
Commit message (Collapse)AuthorAgeFilesLines
* Add weakref support to array.array and file objects.Raymond Hettinger2004-05-311-0/+15
|
* If a file is opened with an explicit buffer size >= 1, repeatedAndrew MacIntyre2004-04-041-0/+17
| | | | | | | | close() calls would attempt to free() the buffer already free()ed on the first close(). [bug introduced with patch #788249] Making sure that the buffer is free()ed in file object deallocation is a belt-n-braces bit of insurance against a memory leak.
* SF bug 801631: file.truncate fault on windows.Tim Peters2003-09-071-0/+28
| | | | | | | | | | | | | | | | | file_truncate(): C doesn't define what fflush(fp) does if fp is open for update, and the preceding I/O operation on fp was input. On Windows, fflush() actually changes the current file position then. Because Windows doesn't support ftruncate() directly, this not only caused Python's file.truncate() to change the file position (contra our docs), it also caused the file not to change size. Repaired by getting the initial file position at the start, restoring it at the end, and tossing all the complicated micro-efficiency checks trying to avoid "provably unnecessary" seeks. file.truncate() can't be a frequent operation, and seeking to the current file position has got to be cheap anyway. Bugfix candidate.
* Somewhere along the way, the softspace attr of file objects became read-Tim Peters2003-05-041-0/+20
| | | | only. Repaired, and added new tests to test_file.py.
* Add next and __iter__ to the list of file methods that should raiseGuido van Rossum2002-08-061-1/+3
| | | | ValueError when called for a closed file.
* Complete the absolute import patch for the test suite. All relativeBarry Warsaw2002-07-301-1/+1
| | | | | | | | imports of test modules now import from the test package. Other related oddities are also fixed (like DeprecationWarning filters that weren't specifying the full import part, etc.). Also did a general code cleanup to remove all "from test.test_support import *"'s. Other from...import *'s weren't changed.
* Patch #488073: AtheOS port.Martin v. Löwis2002-06-111-1/+6
|
* There is no TestError, use TestFailed appropriatelyNeal Norwitz2002-04-011-8/+8
|
* Convert file.readinto() to stop using METH_OLDARGS & PyArg_Parse.Neal Norwitz2002-04-011-0/+15
| | | | Add test for file.readinto().
* SF Patch #494867 test file methodsNeal Norwitz2002-01-011-0/+29
| | | | | | Test that the file methods raise ValueError when called on a closed file. Test .isatty() Test name, closed attributes
* Fiddle with new test cases -- verify that we get a sensible errorJeremy Hylton2001-11-091-4/+7
| | | | | | | message for bad mode argument -- so that it doesn't fail on Windows. It's hack. We know that errno is set to 0 in this case on Windows, so check for that specifically.
* Fix SF buf #476953: Bad more for opening file gives bad msg.Jeremy Hylton2001-11-091-0/+11
| | | | | | If fopen() fails with EINVAL it means that the mode argument is invalid. Return the mode in the error message instead of the filename.
* This patch removes all uses of "assert" in the regression test suiteMarc-André Lemburg2001-01-171-2/+2
| | | | | | | and replaces them with a new API verify(). As a result the regression suite will also perform its tests in optimization mode. Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
* Clean up the temporary file when done with it.Fred Drake2000-10-231-0/+4
|
* New test suite for file objects by Jeremy Hilton. This will needMarc-André Lemburg2000-08-251-0/+45
to be extended somewhat -- right now it only tests the .writelines() method.