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.

Author serhiy.storchaka
Recipients r.david.murray, serhiy.storchaka
Date 2013-11-16.11:44:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The aifc module documentation mentions that underlying file can be unseekable if the number of frames are specified.

   used for writing, the file object should be seekable, unless you know ahead of
   time how many samples you are going to write in total and use
   :meth:`writeframesraw` and :meth:`setnframes`.

But this doesn't work.

>>> import aifc
>>> f ='/dev/stdout', 'w')
>>> f.setnchannels(1)
>>> f.setsampwidth(1)
>>> f.setframerate(8000)
>>> f.setcomptype(b'NONE', b'not compressed')
>>> f.setnframes(1)
>>> f.writeframesraw(b'\0')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/serhiy/py/cpython/Lib/", line 695, in writeframesraw
  File "/home/serhiy/py/cpython/Lib/", line 763, in _ensure_header_written
  File "/home/serhiy/py/cpython/Lib/", line 791, in _write_header
    self._form_length_pos = self._file.tell()
OSError: [Errno 29] Illegal seek

Here is a patch which makes the code to conform with the documentation.
Date User Action Args
2013-11-16 11:44:40serhiy.storchakasetrecipients: + serhiy.storchaka, r.david.murray
2013-11-16 11:44:40serhiy.storchakasetmessageid: <>
2013-11-16 11:44:40serhiy.storchakalinkissue19623 messages
2013-11-16 11:44:39serhiy.storchakacreate