G
G
George1232017-05-13 16:48:36
Python
George123, 2017-05-13 16:48:36

What to do with this error( 'str' does not support the buffer interface)?

There is the following program https://pastebin.com/b0msDk2g and it gives the error 'str' does not support the buffer interface. If it has something to do with byte strings and unicode strings, how do I fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2017-05-13
@Georgy123

If you are using code for Python2, then either run it in Python2, or read how it differs from Python3.

if message != '':
    data = alias + ":" + message
    s.sendto(data.encode('utf-8'), server)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question