Message186567
I can reproduce a similar behaviour, but instead of negative values I obtain huge values(which may as well be a "negative" unsigned converted to a python int).
See this stackoverflow question: http://stackoverflow.com/questions/15934950/python-file-tell-giving-strange-numbers
If it doesn't use ftell() then this might mean that there is a new bug in the current implementation? I can reproduce the results of the questioner, on a windows7 machine with python3.3.0, with the following code:
with open('C:/Users/Giacomo/test', 'wb') as f:
f.write(b'hello\r\n\r\n-data1:blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah\r\n\r\n\r\n-data2:blah blah blah blah blah blah blah blah blah blah blah\r\n-data3: Empty\r\n\r\n-data4: Empty')
with open('C:/Users/Giacomo/test', 'rt') as f:
for line in iter(f.readline, ''):
print(f.tell())
Which outputs:
7
9
18446744073709551714
99
101
164
179
181
194
As I explained in my answer I thought the 1844... was due to the "ftell() bug", but if that's not it I'm at a loss. Could you explain this results with the current implementation?
By the way: it seems to be a python3.3 bug, since python3.2.3 is not affected. |
|
Date |
User |
Action |
Args |
2013-04-11 16:42:06 | bakuriu | set | recipients:
+ bakuriu, arigo, rhettinger, pitrou, brian.curtin, skrah, catalin.iacob, serhiy.storchaka |
2013-04-11 16:42:06 | bakuriu | set | messageid: <1365698526.81.0.739159737447.issue16273@psf.upfronthosting.co.za> |
2013-04-11 16:42:06 | bakuriu | link | issue16273 messages |
2013-04-11 16:42:06 | bakuriu | create | |
|