[ python-Bugs-818006 ] ossaudiodev object does not support common readonly attrs

SourceForge.net noreply at sourceforge.net
Mon Mar 7 02:27:26 CET 2005


Bugs item #818006, was opened at 2003-10-05 02:30
Message generated for change (Settings changed) made by gward
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=818006&group_id=5470

Category: Extension Modules
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Dave Cinege (dcinege)
Assigned to: Greg Ward (gward)
>Summary: ossaudiodev object does not support common readonly attrs

Initial Comment:
fin = ossaudiodev.open(dspfile, 'r') 
if fin.closed == True: 
AttributeError: closed 
 

----------------------------------------------------------------------

Comment By: Terry J. Reedy (tjreedy)
Date: 2005-03-05 15:48

Message:
Logged In: YES 
user_id=593130

I am not sure who your last comment is aimed at.  As near as I 
can tell, Greg merely updated the group to Py2.4, implying that 
this issue is still relevant.

In Pythonese, should is advisory; only must is mandatory.  So I 
see this as a request for a pre-approved enhancement.  Since 
ossaudiodevice directly wraps an OS open file descripter, rather 
than a Python file object, the patch is more than a triviality.

----------------------------------------------------------------------

Comment By: Dave Cinege (dcinege)
Date: 2005-03-05 13:08

Message:
Logged In: YES 
user_id=314434

That was the point of the bug report. It has no closed 
or other file-like attributes. According the python docs 
then and current: 
'File objects also offer a number of other interesting 
attributes. These are not required for file-like objects, 
but should be implemented if they make sense for 
the particular object. ' 
 
I take that to mean these attributes are mandatory, 
unless it does not make sense to implement them. 
 
In the case of file-like Audio Device Objects, they 
make sense, and thus should be there.  
 
Either this statement of file-like object policy is a bug, 
or the lack of such attributes in Audio Device Objects 
is a bug.  
 

----------------------------------------------------------------------

Comment By: Dave Cinege (dcinege)
Date: 2003-10-05 16:32

Message:
Logged In: YES 
user_id=314434

Please see: 
http://python.org/doc/current/lib/bltin-file-objects.html 
""" 
File objects also offer a number of other interesting attributes. 
These are not required for file-like objects, but should be 
implemented if they make sense for the particular object.  
"" 
 
"Should be" when they "make sense"  is my rational for 
reporting this as a bug. 
 
I found this by trying to convert existing code from a normal 
open of /dev/dsp to ossaudiodev.open(), that IMO "should" 
have worked.  : P 
 
Other attributes that "should be" implemented  (mode and 
name) because they "make sense" may also be missing...I 
haven't checked.  
 

----------------------------------------------------------------------

Comment By: Terry J. Reedy (tjreedy)
Date: 2003-10-05 16:16

Message:
Logged In: YES 
user_id=593130

>From Lib Ref 14.11 ossaudiodev "open( [device, ]mode) 
Open an audio device and return an OSS audio device object.
"
Checking http://python.org/doc/current/lib/ossaudio-device-
objects.html 14.11.1 Audio Device Objects I can find no 
mention of closed attribute or indeed of any attributes other 
than methods.  Why were you expecting such?  If report is a 
mistake, please close.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=818006&group_id=5470


More information about the Python-bugs-list mailing list