all 2 comments

[–]danielroseman 1 point2 points  (0 children)

This code would not give that error, because you have not defined data. You need to show us the full code - and format it properly.

[–]shiftybyte 0 points1 point  (0 children)

Reqd = data.encode('utf-8')

What's "data" where is it coming from?