交互模式输入:
f = open( "Config.h", "r+", encoding="UTF-8" )
next(f)
f.tell()
这样会报错:
OSError: telling position disabled by next() call
原因可以理解
但是之后再在交互模式里输入 f.tell() 会报一样的错误
想来是 disabled by next() 还没被恢复
但是 f.seek 重设置一下之后 f.tell 就不会报错了
想问下具体细节是怎样的?
disabled by next() 如何被恢复的?
PS:呃,忘了说,是 Python3……
PS:我知道这是异常……
SAD, I finally solved it myself...
The next source code of the file io set the flag bit
tell will detect the flag
seek will clear the flag (there are too many code distributions so I won’t post it)
Look for the source code yourself for details...