pmarti/python-messaging

TypeError: super() argument 1 must be type, not classobj

nickilo opened this issue · 1 comments

Hello,

I'm trying to create an MMS Smile using the providing example but i have the followings errors

Python 2.7 :
File "test_mms.py", line 9, in
slide1.add_image('/home/nickilo/image1.jpg')
File "/usr/local/lib/python2.7/dist-packages/messaging/mms/message.py", line 341, in add_image
self.image = (DataPart(filename), time_begin, time_end)
File "/usr/local/lib/python2.7/dist-packages/messaging/mms/message.py", line 452, in init
super(DataPart, self).init()
TypeError: super() argument 1 must be type, not classobj

Python 3.5
File "test_mms.py", line 14, in
payload = mms.encode()
File "/usr/local/lib/python3.5/dist-packages/messaging/mms/message.py", line 223, in encode
return encoder.encode(self)
File "/usr/local/lib/python3.5/dist-packages/messaging/mms/mms_pdu.py", line 607, in encode
msg_data.extend(self.encode_message_body())
File "/usr/local/lib/python3.5/dist-packages/messaging/mms/mms_pdu.py", line 801, in encode_message_body
for char in part.data:
File "/usr/local/lib/python3.5/dist-packages/messaging/mms/message.py", line 552, in data
self._data = f.read()
File "/usr/lib/python3.5/codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

Do you have any clue ? Installation was made using pip or pip3.

Thank you,

Regards

I have found a solution for python 2.7, patching messaging/mms/message.py

class DataPart: -> class DataPart(object):