Serhiy Storchaka added the comment:

> 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."

----------
nosy: +serhiy.storchaka
stage: patch review -> needs patch
type: behavior -> enhancement
versions: +Python 3.4 -Python 2.7, Python 3.1, Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5202>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to