This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ossaudiodev not initializing its types
Type: behavior Stage: resolved
Components: Extension Modules Versions: Python 3.1, Python 3.2, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: fluxspir, pitrou, tamentis
Priority: normal Keywords: patch

Created on 2010-03-14 19:36 by tamentis, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ossaudiodev.c.patch tamentis, 2010-03-14 19:36 Patch for Modules/ossaudiodev.c to properly initialize the types
Messages (3)
msg101063 - (view) Author: Bertrand Janin (tamentis) * Date: 2010-03-14 19:36
With Python 3.1.2-rc1, here is what happens when trying to open a mixer:

    Python 3.1.2rc1 (r312rc1:78737, Mar 14 2010, 15:17:09) 
    [GCC 4.3.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import ossaudiodev
    >>> m = ossaudiodev.openmixer()
    >>> m.fileno()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: 'ossaudiodev.oss_mixer_device' object has no attribute 'fileno'

This seems to be due to the fact that the module does not initialize its types with PyType_Ready(), hence the Mixer type never gets its tp_getattro property from its parent type. I attached a small patch to fix this.
msg101555 - (view) Author: Bertrand Janin (tamentis) * Date: 2010-03-23 00:13
This is still an issue in Python 3.1.2 release.
msg101556 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-03-23 00:29
Committed in r79317 (py3k) and r79318 (3.1). Thank you!
History
Date User Action Args
2022-04-11 14:56:58adminsetgithub: 52386
2010-03-23 00:29:49pitrousetstatus: open -> closed

nosy: + pitrou
messages: + msg101556

resolution: fixed
stage: patch review -> resolved
2010-03-23 00:13:09tamentissetmessages: + msg101555
2010-03-15 14:21:08fluxspirsetnosy: + fluxspir
2010-03-14 19:44:59ezio.melottisetpriority: normal
stage: patch review
2010-03-14 19:36:14tamentiscreate