diff --git a/pyreadline/lineeditor/history.py b/pyreadline/lineeditor/history.py index c9f4850..1730cce 100644 --- a/pyreadline/lineeditor/history.py +++ b/pyreadline/lineeditor/history.py @@ -98,6 +98,7 @@ class LineHistory(object): def add_history(self, line): '''Append a line to the history buffer, as if it was the last line typed.''' + line = ensure_unicode(line) if not hasattr(line, "get_line_text"): line = lineobj.ReadLineTextBuffer(line) if not line.get_line_text(): diff --git a/pyreadline/logserver.py b/pyreadline/logserver.py index 06088c9..6ce88c5 100644 --- a/pyreadline/logserver.py +++ b/pyreadline/logserver.py @@ -10,7 +10,7 @@ from __future__ import print_function, unicode_literals, absolute_import import logging import logging.handlers import struct, socket -from .unicode_helper import ensure_unicode +from pyreadline.unicode_helper import ensure_unicode try: import msvcrt except ImportError: