Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #38009

(any)dbm module lacks a context manager

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 <python.list@tim.thechases.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1258.1359658911.2939.python-list@python.org> (permalink)
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

Show key headers only | View raw


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 "<stdin>", line 1, in <module>
AttributeError: '_dbm.dbm' object has no attribute '__exit__'


I'm guessing it's an easy fix? (or even already fixed)

-tkc


Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

(any)dbm module lacks a context manager python.list@tim.thechases.com - 2013-01-31 13:03 -0600

csiph-web