Support name and mode attributes on all file types.

Don't read more than one line when reading text from a tty device.
Add peek() and read1() methods.
Return str instead of unicode when return ASCII characters in text mode.
This commit is contained in:
Guido van Rossum 2007-04-13 18:42:35 +00:00
parent 913dd0be52
commit 13633bb8c5
3 changed files with 83 additions and 18 deletions

View file

@ -51,6 +51,7 @@ def testAttributes(self):
self.assertEquals(f.mode, "w")
self.assertEquals(f.closed, False)
self.assertEquals(f.name, TESTFN)
# verify the attributes are readonly
for attr in 'mode', 'closed':