waveform80/compoundfiles — pull request #5 by vadmium (2014-04-01 08:38:04+00:00)
Title: Fix _struct_ and _array_ format strings in Python 3

Hi, I saw this project mentioned in an OleFileIO bug, and thought I’d try it out. This fixes some issues I had, though I admit I haven’t tested it under Python 2 etc. In Python 3 (3.4 at least), array() does not accept byte string typecodes. Although struct() does accept byte format strings, it is not well documented; see .

Usually when supporting both Python 2 and 3, I use code like `struct(str(format))`, but in this case I had to restore the proper Python 2 str() type for that to work. These changes are just a suggestion; I don’t mind if you fix it another way, though I do think it’s misleading to change the meaning of “str” in Python 2 :P (And beware that I did not restore it in one or two files.)