summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_file.py
Commit message (Collapse)AuthorAgeFilesLines
* Use "x in y" instead of y.find(x) != -1.Ezio Melotti2010-03-171-1/+1
|
* Remove unused imports in test modules.Georg Brandl2010-02-071-1/+1
|
* #7092: Silence more py3k warnings. Patch by Florent Xicluna.Ezio Melotti2010-02-031-1/+1
|
* Reverting the Revision: 77368. I committed Flox's big patch for tests bySenthil Kumaran2010-01-081-1/+1
| | | | mistake. ( It may come in for sure tough)
* Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. ↵Senthil Kumaran2010-01-081-1/+1
| | | | Patch by flox
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-4/+4
|
* Try to restore the old test_file and test_univnewlines as new, different filesAntoine Pitrou2009-06-121-0/+3
| | | | (with the right revisions this time, hopefully)
* Issue #6215: backport the 3.1 io libAntoine Pitrou2009-06-121-326/+95
|
* issue 4804: Provide checks for the format string of strftime, and for the ↵Kristján Valur Jónsson2009-02-041-1/+1
| | | | "mode" string of fopen on Windows. These strings are user provided from python and so we can avoid invoking the C runtime invalid parameter handler by first checking that they are valid.
* #4764 set IOError.filename when trying to open a directory on POSIX platformsBenjamin Peterson2008-12-291-0/+13
|
* As a result of a regression that snuck into 2.5.3 add a test case thatSkip Montanaro2008-12-231-0/+2
| | | | | ensures that when you try to read from a file opened for writing an IOError is raised.
* Issue 4597: Fix several cases in EvalFrameEx where an exception could beJeffrey Yasskin2008-12-081-0/+14
| | | | "raised" without setting x, err, or why to let the eval loop know.
* #3965: on Windows, open() crashes if the filename or the mode is invalid,Amaury Forgeot d'Arc2008-09-251-0/+10
| | | | | | and if the filename is a unicode string. Reviewed by Martin von Loewis.
* #3242: fix a crash in "print", if sys.stdout is set to a custom object,Amaury Forgeot d'Arc2008-07-011-1/+19
| | | | | | whose write() method installs another sys.stdout. Will backport.
* Make file objects as thread safe as the underlying libc FILE* implementation.Gregory P. Smith2008-04-061-1/+167
| | | | | | | | | | | close() will now raise an IOError if any operations on the file object are currently in progress in other threads. Most code was written by Antoine Pitrou (pitrou). Additional testing, documentation and test suite cleanup done by me (gregory.p.smith). Fixes issue 815646 and 595601 (as well as many other bugs and references to this problem dating back to the dawn of Python).
* #2067: file.__exit__() now calls subclasses' close() method.Georg Brandl2008-02-231-1/+17
|
* Test file.__exit__.Georg Brandl2006-06-091-1/+11
|
* Fix grammar and reflowNeal Norwitz2006-06-091-2/+2
|
* testUnicodeOpen(): I have no idea why, but making thisTim Peters2006-06-091-1/+8
| | | | | | | | | test clean up after itself appears to fix the test failures when test_optparse follows test_file. test_main(): Get rid of TESTFN no matter what. That's also enough to fix the mystery failures. Doesn't hurt to fix them twice :-)
* AutoFileTests.tearDown(): Removed mysterious undocumentedTim Peters2006-06-091-27/+28
| | | | | | | try/except. Remove TESTFN. Throughout: used open() instead of file(), and wrapped long lines.
* Whitespace normalization.Tim Peters2006-06-091-1/+1
| | | | | | Since test_file is implicated in mysterious test failures when followed by test_optparse, if I had any brains I'd look at the checkin that last changed test_file ;-)
* Convert test_file to unittest.Georg Brandl2006-06-081-332/+305
|
* Bug #1462152: file() now checks more thoroughly for invalid modeGeorg Brandl2006-05-181-1/+1
| | | | | strings and removes a possible "U" before passing the mode to the C library function.
* Skip the test for sys.stdin.seek(-1) on OSF/1 (Tru64) since it does Bad ThingsNeal Norwitz2006-04-031-5/+11
| | | | | | | | | like cause the interpreter to exit abruptly. If there's a way to fix this, it would be good to really fix it. It could just be the operation of the std C library and we just aren't supposed to do that. When the test case is skipped, we print a message so the user can check for themselves.
* New test code failed to close the file. This causedTim Peters2006-02-141-13/+12
| | | | | | | | | | test_file to fail on Windows in reality (can't delete a still-open file), but a new bare "except:" hid that test_file failed on Windows, and leaving behind the still-open TESTFN caused a cascade of bogus failures in later tests. So, close the file, and stop hiding failure to unlink.
* SF patch #1397960: When mixing file-iteration andThomas Wouters2006-02-121-1/+111
| | | | | | | readline/readlines/read/readinto, loudly break by raising ValueError, rather than silently deliver data out of order or hitting EOF prematurely. Probably not a bugfix candidate, even though it affects no 'working' code.
* Revert r41662 and the part of 41552 that originally caused the problemNeal Norwitz2005-12-151-7/+0
| | | | | (calling ftell(stdin) doesn't seem defined). So we won't test errors from ftell unless we can do it portably.
* mwh spotted a copied error message, make it unique (and correct)Neal Norwitz2005-12-051-1/+1
|
* Fix SF #1373161, r41552 broke test_file on OS XNeal Norwitz2005-12-051-1/+1
| | | | | You apparently can seek(0) on sys.stdin on OS X. But you can't go backwards, so seek(-1).
* Improve test coverage. Hope the test_file changes work the same on windows.Neal Norwitz2005-11-271-0/+33
|
* Disallow opening files with modes 'aU' or 'wU' as specified by PEPSkip Montanaro2005-05-201-0/+10
| | | | 278. Closes bug 967182.
* Fix tests dependent on the exception raised by non-settable descriptors.Barry Warsaw2005-04-201-2/+2
|
* 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.