>>> with open('tranformGBKToUTF8.py') as fp:
... src = fp.read(60)
...
>>> len(src)
60
>>> fp
<_io.TextIOWrapper name='tranformGBKToUTF8.py' mode='r' encoding='cp936'>
>>> fp.closed, fp.encoding
(True, 'cp936')
>>> fp.read(60)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: I/O operation on closed file.