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

>Category: Extension Modules
>Group: None
>Status: Closed
>Resolution: Fixed
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: Greg Ward (gward)
Date: 2005-03-06 20:41

Message:
Logged In: YES 
user_id=14422

For the record, I consider this an enhancement, not a bug
fix.  As the previous commenter pointed out, "should" is not
mandatory.  But it's a useful feature, and I have no
objection to adding it on a stable branch.  So I've checked
it in on 2.4:

Modules/ossaudiodev.c             rev 1.35.4.1
Lib/test/test_ossaudiodev.py      rev 1.8.10.1
Doc/lib/libossaudiodev.tex        rev 1.12.4.2
Lib/test/output/test_ossaudiodev  rev 1.2.12.1

and merged to the trunk:

Modules/ossaudiodev.c             rev 1.36
Lib/test/test_ossaudiodev.py      rev 1.9
Doc/lib/libossaudiodev.tex        rev 1.14
Lib/test/output/test_ossaudiodev  rev 1.3


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

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=355470&aid=818006&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to