Message136306
| 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:34 | vstinner | set | recipients:
+ vstinner, pitrou |
| 2011年05月19日 16:39:34 | vstinner | set | messageid: <1305823174.81.0.878952993902.issue12116@psf.upfronthosting.co.za> |
| 2011年05月19日 16:39:34 | vstinner | link | issue12116 messages |
| 2011年05月19日 16:39:34 | vstinner | create |
|