@@ -717,8 +717,7 @@ def write2file(self):
717717 with open (fn , mode ) as f :
718718 f .write (s )
719719 except IOError as e :
720- self .interact .notify (_ ("Error writing file '%s': %s" ) % (fn ,
721- str (e )))
720+ self .interact .notify (_ ("Error writing file '%s': %s" ) % (fn , e ))
722721 else :
723722 self .interact .notify (_ ('Saved to %s.' ) % (fn , ))
724723
@@ -778,7 +777,7 @@ def do_pastebin_json(self, s):
778777 response = requests .post (url , data = payload , verify = True )
779778 response .raise_for_status ()
780779 except requests .exceptions .RequestException as exc :
781- self .interact .notify (_ ('Upload failed: %s' ) % (str ( exc ) , ))
780+ self .interact .notify (_ ('Upload failed: %s' ) % (exc , ))
782781 return
783782
784783 self .prev_pastebin_content = s
@@ -866,7 +865,7 @@ def insert_into_history(self, s):
866865 self .rl_history .append_reload_and_write (s , self .config .hist_file ,
867866 getpreferredencoding ())
868867 except RuntimeError as e :
869- self .interact .notify (str ( e ))
868+ self .interact .notify (u"%s" % ( e , ))
870869
871870 def prompt_undo (self ):
872871 """Returns how many lines to undo, 0 means don't undo"""
@@ -1081,7 +1080,7 @@ def edit_config(self):
10811080 f .write (default_config )
10821081 except (IOError , OSError ) as e :
10831082 self .interact .notify (_ ("Error writing file '%s': %s" ) %
1084- (self .config .config .path , str ( e ) ))
1083+ (self .config .config .path , e ))
10851084 return False
10861085 else :
10871086 return False
0 commit comments