Error when adding a subfile to a Multifile

AssertionError: fname.is_binary_or_text() at line 489 of c:\buildslave\sdk-windows-i386\build\panda\src\express\multifile.cxx

I get this error when I’m adding a Subfile to a Multifile.

self.multifile = Multifile()
self.multifile.openReadWrite(mf_path)
self.multifile.addSubfile("/sounds/"+Filename(path).get_basename(), Filename(path), 5)

The target is to load in a sound stored at “path” and then insert it into a subdirectory “sounds” named after the sounds name. Example: C:/…/sound.wav --> /sounds/sound.wav

Does anyone know how to fix this error?

The error indicates that the nature (binary or text) of the source file wasn’t specified.
As it’s a binary file, try this:

self.multifile.addSubfile("/sounds/"+Filename(path).get_basename(), Filename.binaryFilename(path), 5)