Message182113
| 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:51 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, terry.reedy, gpolo, drj |
| 2013年02月14日 17:58:51 | serhiy.storchaka | set | messageid: <1360864731.28.0.244384514528.issue5202@psf.upfronthosting.co.za> |
| 2013年02月14日 17:58:51 | serhiy.storchaka | link | issue5202 messages |
| 2013年02月14日 17:58:51 | serhiy.storchaka | create |
|