Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nickilo opened this issue Jan 12, 2021 · 1 comment
Open

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

nickilo opened this issue Jan 12, 2021 · 1 comment

Comments

@nickilo
Copy link

nickilo commented Jan 12, 2021

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

@nickilo
Copy link
Author

nickilo commented Jan 13, 2021

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

class DataPart: -> class DataPart(object):

@nickilo nickilo changed the title Exemple execution error TypeError: super() argument 1 must be type, not classobj Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant