[New-bugs-announce] [issue6518] Enable 'with' statement in ossaudiodev module

Jerzy Jalocha N report at bugs.python.org
Sun Jul 19 03:07:46 CEST 2009


New submission from Jerzy Jalocha N <jjalocha at gmail.com>:

Actually, it is not possible to use the 'with' statement in the
ossaudiodev module:

>>> import ossaudiodev
>>> with ossaudiodev.open('/dev/dsp', 'r') as device:
...     pass
...
Traceback (most recent call last):
  File "<stdin>", line 1 in <module>
AttributeError: 'ossaudodev.oss_audio_device' object has no attribute
'__exit__'

In order to provide a similar interface as standard Python files, and
encourage safe coding practices, the 'with' statement should be
supported in the ossaudiodev module.

Thanks.

----------
components: Extension Modules
messages: 90697
nosy: jjalocha
severity: normal
status: open
title: Enable 'with' statement in ossaudiodev module
type: feature request
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6518>
_______________________________________


More information about the New-bugs-announce mailing list