Re: Blocked with Ordered broken on Win32 (was Database binary compatibility?)
"William K. Volkman" <[email protected]>
| Newsgroups | gmane.comp.db.metakit |
|---|---|
| Message-ID | <1095720708.8245.94.camel@wkv1> |
On Mon, 2004-09-20 at 16:41, Brian Kelley wrote:
> I'll bet you a beer that I know what you are doing wrong here (because
> I've done the same thing :) )
>
Where are you? I'd like to collect (just kidding ;-)
grep -Hn open dbrestore.py
dbrestore.py:42:r = open('backup-data.sav','rb')
Good thought though.
> If you load or save on windows, you MUST supply the binary flag.
>
> read
> file = open("foo", "b")
>
> write
> file = open('foo", "wb")
>
> Another reason why windows stinks (IMHO). If you want portable
> metakit, whenever you use save or load just add the stupid binary
> flag.
The attached simple program pukes garbage on the screen
and after a couple of runs gives me the
SystemError: error return without exception set.
Do you have a Windows system that you could test it on?
--
William K. Volkman <[email protected]>
_____________________________________________
Metakit mailing list - [email protected]
http://www.equi4.com/mailman/listinfo/metakit
bugone.py
(application/x-python, 372 B)
import metakit
db = metakit.storage('bug.mk',1)
vw = db.getas('myview[_B[id:s,name:s,addr:s]]').blocked().ordered(2)
for id, name, addr in (('1','one','111'),('2','two','222'),('3','three','333'),('4','four','444')):
print id, name, addr
vw.append(id=id, name=name, addr=addr)
db.commit()
for row in vw:
print row.id, row.name, row.addr
metakit.dump(vw)