Prev: Pycrypto RSA Issue
Next: EAFP gone wrong
From: seth on 9 Feb 2010 16:42 There is something you could possibly help me with. We have a code that creates a simple Python shelve database. We are able to serialize objects and store them in the dbm file. This seem to work the same on Windows XP Python 2.5, Ubuntu 9.1 with Python 2.6, but on Os X 10.5 with Python 2.5 the database filename is changed by the operating system by attaching the .db extension to it. Does an one know why is that? What is worse, at the time of reading it we get the error below the extracted code, on Os X 10.5: if os.path.exists( tarname )and tarfile.is_tarfile( tarname ): try: datastore_tarfile=tarfile.open( tarname, 'r:gz' ) print "Successfully opened the tarball: %s"%tarname members=datastore_tarfile.getnames() for dbmFile in members: datastore_tarfile.extract( dbmFile ) print "Extracting Realizations File: %s"%dbmFile realizations=shelve.open( dbmFile, 'c', 2, writeback = False ) Successfully opened the tarball: datastore.tar.gz Extracting Realizations File: realizations.dbm.db <class 'bsddb.error'> (22, 'Invalid argument') This does not happen on Windows XP with Python 2.5. Does anyone know what is happening on Os X? Any comments and suggestions will be greatly appreciated. Thank you very much in advance.
From: Aahz on 14 Feb 2010 13:21 In article <7a9d26a8-0a9f-4bf3-bf50-0ac5e337f482(a)r24g2000yqd.googlegroups.com>, seth <hklasky(a)gmail.com> wrote: > >We have a code that creates a simple Python shelve database. We are >able to serialize objects and store them in the dbm file. This seem to >work the same on Windows XP Python 2.5, Ubuntu 9.1 with Python 2.6, >but on Os X 10.5 with Python 2.5 the database filename is changed by >the operating system by attaching the .db extension to it. Does an one >know why is that? Nope -- any reason you can't change the filename? -- Aahz (aahz(a)pythoncraft.com) <*> http://www.pythoncraft.com/ "At Resolver we've found it useful to short-circuit any doubt and just refer to comments in code as 'lies'. :-)"
|
Pages: 1 Prev: Pycrypto RSA Issue Next: EAFP gone wrong |