Make a few more tests pass with the new I/O library.

Fix the truncate() semantics -- it should not affect the current position.
Switch wave.py/chunk.py to struct.unpack_from() to support bytes.
Don't use writelines() on binary files (test_fileinput.py).
This commit is contained in:
Guido van Rossum 2007-04-12 22:55:07 +00:00
parent b6f1fdc90c
commit dc0b1a1069
6 changed files with 16 additions and 20 deletions

View file

@ -18,7 +18,8 @@ from fileinput import FileInput, hook_encoded
def writeTmp(i, lines, mode='w'): # opening in text mode is the default
name = TESTFN + str(i)
f = open(name, mode)
f.writelines(lines)
for line in lines:
f.write(line)
f.close()
return name