it looks like its bad to use a mixture of file.seek and os.lseek
[derekh@laptop tmp]$ cat t.py import os
body = open("testfile")
body.seek(0, os.SEEK_END) body.seek(0) os.lseek(body.fileno(), 0, os.SEEK_SET)
print body.read()
[derekh@laptop tmp]$ cat testfile Hello World [derekh@laptop tmp]$ python t.py Hello World Hello World
this sequence happens in the glance client on the stdin file object in glance/client.py - _get_image_size and glance/common/client.py _seekable
it looks like its bad to use a mixture of
file.seek and os.lseek
[derekh@laptop tmp]$ cat t.py
import os
body = open("testfile")
body.seek(0, os.SEEK_END) body.fileno( ), 0, os.SEEK_SET)
body.seek(0)
os.lseek(
print body.read()
[derekh@laptop tmp]$ cat testfile
Hello World
[derekh@laptop tmp]$ python t.py
Hello World
Hello World
this sequence happens in the glance client on the stdin file object in common/ client. py _seekable
glance/client.py - _get_image_size
and
glance/