Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Fix unicode encoding errors in gnsync.py #97

Merged
merged 1 commit into from
Aug 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions geeknote/gnsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def _create_file(self, note):
binaryHash = binascii.unhexlify(imageInfo['hash'])
GeekNote(sleepOnRateLimit=self.sleep_on_ratelimit).saveMedia(note.guid, binaryHash, filename)

content = Editor.ENMLtoText(note.content, self.imageOptions)
content = Editor.ENMLtoText(note.content.encode('utf-8'), self.imageOptions)
path = os.path.join(self.path, escaped_title + self.extension)
open(path, "w").write(content)
updated_seconds = note.updated / 1000.0
Expand Down Expand Up @@ -461,7 +461,7 @@ def _get_notes(self):
"""
Get notes from evernote.
"""
keywords = 'notebook:"{0}"'.format(tools.strip(self.notebook_name))
keywords = 'notebook:"{0}"'.format(tools.strip(self.notebook_name.encode('utf-8')))
return GeekNote(sleepOnRateLimit=self.sleep_on_ratelimit).findNotes(keywords, EDAM_USER_NOTES_MAX).notes


Expand Down