This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: AttributeError in the shelve module
Type: Stage:
Components: Extension Modules Versions: Python 2.4
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: aomighty, georg.brandl
Priority: normal Keywords:

Created on 2006-07-10 06:25 by aomighty, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg29115 - (view) Author: Martin Kelly (aomighty) Date: 2006-07-10 06:25
This is Python 2.4.4 on Debian Etch.

Look at the following interpreter session:

    Python 2.4.4c0 (#2, Jun 14 2006, 22:35:41)
    [GCC 4.1.2 20060613 (prerelease) (Debian 4.1.1-4)]
        on linux2
    Type "help", "copyright", "credits" or "license"
for more information.
    >>> import shelve
    >>> import anydbm
    >>> try:
    ...     shelve.open('nonexistent', 'r')
    ... except anydbm.error:
    ...     print 'caught it'
    ... 
    caught it
    Exception exceptions.AttributeError:
"DbfilenameShelf instance has no
    attribute 'writeback'" in  ignored
    >>> anydbm.error
    (<class anydbm.error at 0xb7f48bfc>,
     <class bsddb._db.DBError at 0xb7f5623c>,
     <class gdbm.error at 0xb7f48cbc>,
     <class dbm.error at 0xb7f5b38c>,
     <class exceptions.IOError at 0xb7f774ac>)
    >>>

Shelf.__del__() calls Shelf.close() calls Shelf.sync()
which
references self.writeback even though that attribute
doesn't exist.
It also references self.dict which also doesn't exist.
msg29116 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-07-10 06:50
Logged In: YES 
user_id=849994

Thanks for reporting. This was already fixed in SVN head.
History
Date User Action Args
2022-04-11 14:56:18adminsetgithub: 43641
2006-07-10 06:25:21aomightycreate