Aug-12-2017, 09:38 AM
Somewhere in your code, list object is passed instead of a string. Try an IDE to debug.
eg-
You'll get-
Instead you have to pass the string contained in the list.
eg-
1 2 |
>>> mylist = [ 'mystring' ] >>> mylist.encode( 'utf-8' ) |
Error:Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'list' object has no attribute 'encode'
Instead you have to pass the string contained in the list.
1 |
>>> mylist[ 0 ].encode( 'utf-8' ) / / first element of List |
Output:b'mystring'