For my own learning I have used an example to show that I can change a str
type to bytes with
b = g.toEncodedString(my_string)
and confirmed the change with the type() function.
But from the log I can't recognise what the str is that needs changing in
File "N:\git\leo-editor\leo\plugins\pygeotag\pygeotag.py", line 184, in
line 775, in write
TypeError: a bytes-like object is required, not 'str'
Can you explain how to identify the str structure so I can apply the
On Saturday, January 27, 2018 at 12:25:41 AM UTC+11, Edward K. Ream wrote:
> In Leo, the best way (usually) to convert from a string to bytes type is
> b = g.toEncodedString(aString)
> This handles differences between python 2 and 3, and handles error
> checking when aString.encode throws an exception. It also works when
> aString is already a bytes object.
> Similarly, g.toUnicode(obj) is the best way to convert from bytes to
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to email@example.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.