Message56591
Brett Cannon wrote:
> Brett Cannon added the comment:
>
> OK, for some reason, when PyTokenizer_FindEncoding() is called and the
> resulting file is big enough, it starts off with a seek position
> (according to TextIOWrapper.tell()) of 4096. That happens to be exactly
> half the size of the buffer used by io.
>
> But I am not sure what the magical size is as creating a file of 4095,
> 4096, and 4097 bytes does not trigger this bug.
Maybe rewind() doesn't do what is should do? Could you replace the
rewind() calls with fseek(fd, 0, 0)?
w/o the rewind() calls in PyTokenizer_FindEncoding I'm getting an error
in my new test:
Traceback (most recent call last):
File "Lib/test/test_imp.py", line 66, in <module>
test_main()
File "Lib/test/test_imp.py", line 62, in test_main
ImportTests,
File "/home/heimes/dev/python/py3k/Lib/test/test_support.py", line
541, in run_unittest
_run_suite(suite)
File "/home/heimes/dev/python/py3k/Lib/test/test_support.py", line
524, in _run_suite
raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
File "Lib/test/test_imp.py", line 50, in test_issue1267
self.assertEqual(fd.tell(), 0)
AssertionError: 4096 != 0
The number is looking familiar, isn't it? :) Is it the default buffer
size on Unix?
Christian |
|
Date |
User |
Action |
Args |
2007-10-20 02:33:56 | christian.heimes | set | spambayes_score: 0.00321011 -> 0.0032101145 recipients:
+ christian.heimes, gvanrossum, brett.cannon |
2007-10-20 02:33:56 | christian.heimes | link | issue1267 messages |
2007-10-20 02:33:55 | christian.heimes | create | |
|