~ubuntu-branches/ubuntu/precise/python3.2/precise-proposed

« back to all changes in this revision

Viewing changes to Doc/faq/library.rst

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-03-09 18:40:39 UTC
  • mfrom: (30.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120309184039-j3yk2emxr1plyo21
Tags: 3.2.3~rc1-1
* Python 3.2.3 release candidate 1.
* Update to 20120309 from the 3.2 branch.
* Fix libpython.a symlink. Closes: #660146.
* Build-depend on xauth.
* Run the gdb tests for the debug build only.

Show diffs side-by-side

added added

removed removed

Lines of Context:
814
814
general such as using gdbm with pickle/shelve.
815
815
 
816
816
 
817
 
If my program crashes with a bsddb (or anydbm) database open, it gets corrupted. How come?
818
 
------------------------------------------------------------------------------------------
819
 
 
820
 
.. XXX move this FAQ entry elsewhere?
821
 
 
822
 
.. note::
823
 
 
824
 
   The bsddb module is now available as a standalone package `pybsddb
825
 
   <http://www.jcea.es/programacion/pybsddb.htm>`_.
826
 
 
827
 
Databases opened for write access with the bsddb module (and often by the anydbm
828
 
module, since it will preferentially use bsddb) must explicitly be closed using
829
 
the ``.close()`` method of the database.  The underlying library caches database
830
 
contents which need to be converted to on-disk form and written.
831
 
 
832
 
If you have initialized a new bsddb database but not written anything to it
833
 
before the program crashes, you will often wind up with a zero-length file and
834
 
encounter an exception the next time the file is opened.
835
 
 
836
 
 
837
 
I tried to open Berkeley DB file, but bsddb produces bsddb.error: (22, 'Invalid argument'). Help! How can I restore my data?
838
 
----------------------------------------------------------------------------------------------------------------------------
839
 
 
840
 
.. XXX move this FAQ entry elsewhere?
841
 
 
842
 
.. note::
843
 
 
844
 
   The bsddb module is now available as a standalone package `pybsddb
845
 
   <http://www.jcea.es/programacion/pybsddb.htm>`_.
846
 
 
847
 
Don't panic! Your data is probably intact. The most frequent cause for the error
848
 
is that you tried to open an earlier Berkeley DB file with a later version of
849
 
the Berkeley DB library.
850
 
 
851
 
Many Linux systems now have all three versions of Berkeley DB available.  If you
852
 
are migrating from version 1 to a newer version use db_dump185 to dump a plain
853
 
text version of the database.  If you are migrating from version 2 to version 3
854
 
use db2_dump to create a plain text version of the database.  In either case,
855
 
use db_load to create a new native database for the latest version installed on
856
 
your computer.  If you have version 3 of Berkeley DB installed, you should be
857
 
able to use db2_load to create a native version 2 database.
858
 
 
859
 
You should move away from Berkeley DB version 1 files because the hash file code
860
 
contains known bugs that can corrupt your data.
861
 
 
862
 
 
863
817
Mathematics and Numerics
864
818
========================
865
819