diff --git a/things/things.py b/things/things.py index eb263fb..30dc124 100644 --- a/things/things.py +++ b/things/things.py @@ -41,7 +41,7 @@ class ToDo(object): self.todos = [] if path.exists(saved_file): - with open(saved_file) as fp: + with open(saved_file, 'rb+') as fp: self.todos = pickle.load(fp) @@ -70,7 +70,7 @@ class ToDo(object): self._save() def _save(self): - with open(self.saved_file, "w+") as fp: + with open(self.saved_file, "wb+") as fp: pickle.dump(self.todos, fp) def print_todo(self): @@ -78,7 +78,7 @@ class ToDo(object): # print "{0} TO-DO-List {0}".format("*"*32) for index, thing in enumerate(self.todos): if thing.undo: - print TermColor.RED + TermSign.START + TermColor.END, + print TermColor.RED + TermSign.START.decode() + TermColor.END, print " {0}. {1}".format(index+1, thing.name) print @@ -87,9 +87,9 @@ class ToDo(object): # print "{0} Archieve-List {0}".format("*"*32) for index, thing in enumerate(self.todos): if thing.undo: - print TermColor.RED + TermSign.START + TermColor.END, + print TermColor.RED + TermSign.START.decode() + TermColor.END, else: - print TermColor.GREEN + TermSign.CHECK + TermColor.END, + print TermColor.GREEN + TermSign.CHECK.decode() + TermColor.END, print " {0}. {1}".format(index+1, thing.name) print -- 2.24.1