--- mlt-0.9.6.orig/src/swig/mlt.i	2015-10-06 18:38:00.431948838 +0200
+++ mlt-0.9.6/src/swig/mlt.i	2015-10-07 11:12:51.609969196 +0200
@@ -237,7 +237,15 @@
 %}
 
 %typemap(out) binary_data {
+%#if PY_VERSION_HEX >= 0x03000000
+%#if PY_VERSION_HEX >= 0x03010000
+	$result = PyUnicode_DecodeUTF8( $1.data, $1.size , "surrogateescape" );
+%#else
+	$result = PyUnicode_FromStringAndSize( $1.data, $1.size );
+%#endif
+%#else
 	$result = PyString_FromStringAndSize( $1.data, $1.size );
+%#endif
 }
 
 binary_data frame_get_waveform(Mlt::Frame&, int, int);
