This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients pitrou, vstinner
Date 2011-05-19.16:39:34
SpamBayes Score 0.0010677512
Marked as misclassified No
Message-id <1305823174.81.0.878952993902.issue12116@psf.upfronthosting.co.za>
In-reply-to
Content
And how can I seek the raw file to zero?

Using buffer.raw.seek(0), buffer.tell() becomes inconsistent:

$ ./python 
Python 3.2.1b1 (3.2:bd5e4d8c8080, May 15 2011, 10:22:54) 
>>> buffer=open('setup.py', 'rb')
>>> buffer.read(1)
>>> buffer.tell()
1
>>> buffer.raw.tell()
4096
>>> buffer.raw.seek(0)
0
>>> buffer.raw.tell()
0
>>> buffer.tell()
-4095

Same problem with os.lseek():

$ ./python 
Python 3.2.1b1 (3.2:bd5e4d8c8080, May 15 2011, 10:22:54) 
>>> import os
>>> buffer=open("setup.py", "rb")
>>> buffer.read(1)
>>> os.lseek(buffer.fileno(), 0, 0)
0
>>> buffer.raw.tell()
0
>>> buffer.tell()
-4095
History
Date User Action Args
2011-05-19 16:39:34vstinnersetrecipients: + vstinner, pitrou
2011-05-19 16:39:34vstinnersetmessageid: <1305823174.81.0.878952993902.issue12116@psf.upfronthosting.co.za>
2011-05-19 16:39:34vstinnerlinkissue12116 messages
2011-05-19 16:39:34vstinnercreate