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 drj, gpolo, serhiy.storchaka, terry.reedy
Date 2013-02-14.17:58:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1360864731.28.0.244384514528.issue5202@psf.upfronthosting.co.za>
In-reply-to
Content
> Now, is there some problem if we remove the calls to the "tell" method
> in _write_header ? See patch attached (tests are very welcome too).

Yes, there is a problem. User can pass already open file to wave.open() and file position can be not 0 at the start of the WAVE file. But you can do with only one tell(). Note a magic number 36 in many places of the code. This is struct.calcsize(wave_header_format).

Test is needed as well as a documentation change.

I think this is rather a new feature and should be added only in 3.4. Actually the current behavior is documented: "If *file* is a string, open the file by that name, otherwise treat it as a seekable file-like object."
History
Date User Action Args
2013-02-14 17:58:51serhiy.storchakasetrecipients: + serhiy.storchaka, terry.reedy, gpolo, drj
2013-02-14 17:58:51serhiy.storchakasetmessageid: <1360864731.28.0.244384514528.issue5202@psf.upfronthosting.co.za>
2013-02-14 17:58:51serhiy.storchakalinkissue5202 messages
2013-02-14 17:58:51serhiy.storchakacreate