[migration] Ignore IOError from readline.write_history_file (closes #2106621) stable
authorJulien Cristau <julien.cristau@logilab.fr>
Mon, 05 Dec 2011 14:31:43 +0100
branchstable
changeset 8108 91868ec92391
parent 8107 e5858a4a1244
child 8115 2ad4e5173c73
[migration] Ignore IOError from readline.write_history_file (closes #2106621) We already ignore them when reading the histfile, no reason writing it back should be any different.
migration.py
--- a/migration.py	Mon Dec 05 14:31:41 2011 +0100
+++ b/migration.py	Mon Dec 05 14:31:43 2011 +0100
@@ -269,7 +269,10 @@
         def unicode_raw_input(prompt):
             return unicode(raw_input(prompt), sys.stdin.encoding)
         interact(banner, readfunc=unicode_raw_input, local=local_ctx)
-        readline.write_history_file(histfile)
+        try:
+            readline.write_history_file(histfile)
+        except IOError:
+            pass
         # delete instance's confirm attribute to avoid questions
         del self.confirm
         self.need_wrap = True