> On Aug 13, 2007, at 5:55 PM, Matthew Scott wrote:
>
> >
> > Under Windows, FileStorage2 works great but ShelfStorage has a weird
> > error. I don't have a patch for it yet,
An update.
Here is the script that I am running to debug this problem:
from os import unlink, path
if path.exists('foo.durus'):
unlink('foo.durus')
from durus.file_storage import ShelfStorage
s = ShelfStorage('foo.durus')
When debugging it using winpdb in both WinXP and MacOSX, the diversion
occurred here, at line 36 of durus.utils:
def read(f, n):
if TRACE:
print 'read(%r, %r)' % (f, n),
read = getattr(f, 'read', None)
if read is not None:
result = read(n) # <-- line 36
if len(result) < n:
raise ShortRead()
Executing this line on OSX resulted in result == ''. However,
executing it on WinXP resulted in result ==
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
0\x00\x00\x00\x00'.
When I "eval f.tell()" at this point on WinXP, the position is 40.
When I do that in OSX, the position is 16.
I'm probably going to learn everything I (n)ever wanted to know about
file handling in Windows (but was afraid to ask) by hunting down this
bug :)
More details soon, as I uncover them...
--
Matthew R. Scott