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


Groups > comp.lang.python > #38009 > unrolled thread

(any)dbm module lacks a context manager

Started bypython.list@tim.thechases.com
First post2013-01-31 13:03 -0600
Last post2013-01-31 13:03 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

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

#38009 — (any)dbm module lacks a context manager

Frompython.list@tim.thechases.com
Date2013-01-31 13:03 -0600
Subject(any)dbm module lacks a context manager
Message-ID<mailman.1258.1359658911.2939.python-list@python.org>
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


[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web