Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'attribute': 0.05; 'python': 0.09; 'subject:module': 0.09; '-tkc': 0.16; '3.1.3': 0.16; 'box:': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'guessing': 0.16; 'remedied': 0.16; '>>>': 0.18; '(or': 0.18; 'import': 0.21; '"",': 0.22; "i've": 0.23; 'seems': 0.23; '(most': 0.27; "i'm": 0.29; 'file': 0.32; 'traceback': 0.33; 'to:addr:python-list': 0.33; 'version': 0.34; 'nov': 0.35; 'but': 0.36; 'should': 0.36; 'charset:us- ascii': 0.36; 'object': 0.38; '2010,': 0.38; 'to:addr:python.org': 0.39; 'easy': 0.60; 'from:no real name:2**0': 0.60; 'more': 0.63; 'received:50.22': 0.84; 'subject:any': 0.84; 'received:108': 0.91 Date: Thu, 31 Jan 2013 13:03:05 -0600 From: python.list@tim.thechases.com To: python-list@python.org Subject: (any)dbm module lacks a context manager X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1359658911 news.xs4all.nl 6957 [2001:888:2000:d::a6]:59216 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38009 I don't know if this has been remedied in a more recent version than I've got on my box (Debian Stable), but it seems like it should work out of the box: Python 3.1.3 (r313:86834, Nov 28 2010, 10:01:07) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import dbm >>> with dbm.open("mydb", 'c') as d: ... d["hello"] = "world" ... Traceback (most recent call last): File "", line 1, in AttributeError: '_dbm.dbm' object has no attribute '__exit__' I'm guessing it's an easy fix? (or even already fixed) -tkc