[issue16461] wave module: wrong integer format

2012-11-12 Thread Christian Kern

New submission from Christian Kern:

Writing .wav files is limited to a file size of 2 Gib, while
the WAV file format itself supports up to 4 Gib.
Trying to write a file beyond 2 Gib (e.g. 203 minutes at
CD quality (i.e. 44.1 kHz, 2 channels, 16 bit)) will crash
at the moment when self._datawritten exceeds 2^31-1 bytes.
This is due to the fact that, in method "_patchheader",
the variable "self._datawritten" is written with
"struct.pack(' self._file.write(struct.pack(' self._file.write(struct.pack(' self._file.write(struct.pack('http://bugs.python.org/file27971/mkdummywav.py

___
Python tracker 
<http://bugs.python.org/issue16461>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16461] wave module: wrong integer format

2012-11-12 Thread Christian Kern

Christian Kern added the comment:

Addendum: 4 Gib file size can only be achieved with "unsigned
long". Moreover, for numbers < 2^31, "signed long" and
"unsigned long" seem to be the same, so there should arise
no problem. (Tested on x86_64 linux)

BTW: Writing .wav files could gain performance it there'd be
an option for updating the header only at the end of writing.

--

___
Python tracker 
<http://bugs.python.org/issue16461>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com