Commit Graph

51 Commits

Author SHA1 Message Date
Serhiy Storchaka
ea4d2875ac Issue #20557: Use specific asserts in io tests. 2015-08-02 15:19:04 +03:00
Benjamin Peterson
7b26a5a32d properly explicitly close file (#21128) 2014-04-04 13:56:26 -04:00
Ezio Melotti
e21b6ae725 #14853: remove test that was making too many assumptions about stdin. Patch by Elena Oat. 2013-07-25 05:21:00 +02:00
Ezio Melotti
2623a37852 Merged revisions 86596 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line

  #9424: Replace deprecated assert* methods in the Python test suite.
........
2010-11-21 13:34:58 +00:00
Ezio Melotti
187f93d986 Use "x in y" instead of y.find(x) != -1. 2010-03-17 14:22:34 +00:00
Georg Brandl
a4f46e1292 Remove unused imports in test modules. 2010-02-07 17:03:15 +00:00
Ezio Melotti
dde5b94875 #7092: Silence more py3k warnings. Patch by Florent Xicluna. 2010-02-03 05:37:26 +00:00
Senthil Kumaran
ce8e33a095 Reverting the Revision: 77368. I committed Flox's big patch for tests by
mistake. ( It may come in for sure tough)
2010-01-08 19:04:16 +00:00
Senthil Kumaran
3ddc435af6 Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. Patch by flox 2010-01-08 18:41:40 +00:00
Benjamin Peterson
5c8da86f3a convert usage of fail* to assert* 2009-06-30 22:57:08 +00:00
Antoine Pitrou
47a5f48006 Try to restore the old test_file and test_univnewlines as new, different files
(with the right revisions this time, hopefully)
2009-06-12 20:41:52 +00:00
Antoine Pitrou
1969059327 Issue #6215: backport the 3.1 io lib 2009-06-12 20:14:08 +00:00
Kristján Valur Jónsson
fd4c872726 issue 4804: Provide checks for the format string of strftime, and for the "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. 2009-02-04 10:05:25 +00:00
Benjamin Peterson
fe231b07e4 #4764 set IOError.filename when trying to open a directory on POSIX platforms 2008-12-29 17:47:42 +00:00
Skip Montanaro
f205c13fac As a result of a regression that snuck into 2.5.3 add a test case that
ensures that when you try to read from a file opened for writing an IOError
is raised.
2008-12-23 03:30:15 +00:00
Jeffrey Yasskin
2d873bd68b Issue 4597: Fix several cases in EvalFrameEx where an exception could be
"raised" without setting x, err, or why to let the eval loop know.
2008-12-08 18:55:24 +00:00
Amaury Forgeot d'Arc
17617a07d1 #3965: on Windows, open() crashes if the filename or the mode is invalid,
and if the filename is a unicode string.

Reviewed by Martin von Loewis.
2008-09-25 20:52:56 +00:00
Amaury Forgeot d'Arc
bdd941fac3 #3242: fix a crash in "print", if sys.stdout is set to a custom object,
whose write() method installs another sys.stdout.

Will backport.
2008-07-01 20:38:04 +00:00
Gregory P. Smith
aa63d0d4af Make file objects as thread safe as the underlying libc FILE* implementation.
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).
2008-04-06 23:11:17 +00:00
Georg Brandl
ad61bc8d9b #2067: file.__exit__() now calls subclasses' close() method. 2008-02-23 15:11:18 +00:00
Georg Brandl
e7ec81f130 Test file.__exit__. 2006-06-09 18:29:52 +00:00
Neal Norwitz
c9778a8951 Fix grammar and reflow 2006-06-09 05:54:18 +00:00
Tim Peters
0556e9b119 testUnicodeOpen(): I have no idea why, but making this
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 :-)
2006-06-09 04:02:06 +00:00
Tim Peters
dbb82f623f AutoFileTests.tearDown(): Removed mysterious undocumented
try/except.  Remove TESTFN.

Throughout:  used open() instead of file(), and wrapped
long lines.
2006-06-09 03:51:41 +00:00
Tim Peters
520d8ddd97 Whitespace normalization.
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 ;-)
2006-06-09 02:11:02 +00:00