durusmail: durus-users: Durus 3.7 and Windows
Durus 3.7 and Windows
2007-08-08
2007-08-08
2007-08-08
2007-08-13
2007-08-14
2007-08-14
2007-08-14
2007-08-14
2007-08-15
2007-08-15
2007-08-15
2007-08-15
2007-08-15
Durus 3.7 and Windows
Matthew Scott
2007-08-13
On 8/8/07, David Binger  wrote:
>
> On Aug 7, 2007, at 11:28 PM, David K. Hess wrote:
>
> > I collected up the various issues related to 3.7 for Windows that
> > popped up on the list into the following patch. Does this seem to
> > folks to be the changes necessary for 3.7 on Windows?
>
> Your diff seems to be all we have in the development tree that is
> related
> to Windows.  If anyone knows of other necessary changes, please
> remind us of them.


I made an interim branch of 3.7 at
http://schevo.org/svn/thirdparty/durus-3.7-schevo1 so we could use
that for Schevo until Durus 3.8 was released.  It is patched with the
changes noted by David Hess at the beginning of this thread.

FileStorage2 and ShelfStorage both work great in OSX, and all the
Schevo unit tests pass against it wonderfully.

Under Windows, FileStorage2 works great but ShelfStorage has a weird
error. I don't have a patch for it yet, and will probably focus on
something else for the rest of the day, but here are the symptoms:

Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from durus.file_storage import ShelfStorage
>>> s = ShelfStorage('foo.durus')
0
16
Traceback (most recent call last):
  File "", line 1, in ?
  File "c:\env\schevo24\lib\python2.4\durus-3.7_schevo1-py2.4-win32.egg\durus\fi
le_storage.py", line 73, in __init__
    self.shelf = Shelf(filename, readonly=readonly, repair=repair)
  File "c:\env\schevo24\lib\python2.4\durus-3.7_schevo1-py2.4-win32.egg\durus\sh
elf.py", line 76, in __init__
    for result in self.generate_shelf(file=file, items=items or []):
  File "c:\env\schevo24\lib\python2.4\durus-3.7_schevo1-py2.4-win32.egg\durus\sh
elf.py", line 123, in generate_shelf
    offset_map = OffsetMap(file)
  File "c:\env\schevo24\lib\python2.4\durus-3.7_schevo1-py2.4-win32.egg\durus\sh
elf.py", line 331, in __init__
    maximum_int=self.start + max_oid + 2)
  File "c:\env\schevo24\lib\python2.4\durus-3.7_schevo1-py2.4-win32.egg\durus\ut
ils.py", line 377, in __init__
    number_of_words=number_of_ints)
  File "c:\env\schevo24\lib\python2.4\durus-3.7_schevo1-py2.4-win32.egg\durus\ut
ils.py", line 316, in __init__
    assert bytes == 16 + bytes_per_word * number_of_words
AssertionError

The two numbers that appear before the traceback are a result of these
two print statements that were added:

(schevo24) C:\env\schevo24\src\durus-3.7-schevo1>svn diff
Index: utils.py
===================================================================
--- utils.py    (revision 3459)
+++ utils.py    (working copy)
@@ -311,6 +311,8 @@
             write(self.file, int8_to_str(bytes))
             write(self.file, int8_to_str(bytes_per_word))
             write(self.file, int8_to_str(number_of_words))
+        print bytes
+        print 16 + bytes_per_word * number_of_words
         assert bytes == 16 + bytes_per_word * number_of_words
         self.byte_array = ByteArray(bytes_per_word * number_of_words, file=file
)
         self.bytes_per_word = bytes_per_word


If you do it multiple times, you get different results:

>>> s = ShelfStorage('foo2.durus')
2314960595136307039
55534600716798432807220177071848386160
Traceback (most recent call last):
....

>>> s = ShelfStorage('foo3.durus')
0
16
Traceback (most recent call last):
....

>>> s = ShelfStorage('foo4.durus')
2314885532166023534
19370490768225265408745822168856633680
Traceback (most recent call last):
....

>>> s = ShelfStorage('foo5.durus')
2314885532166023534
19370490768225265408745822168856633680
Traceback (most recent call last):
....

--
Matthew R. Scott
reply