[migration] Drop custom "readfunc" for code.interact in shell
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 02 Jun 2016 17:52:43 +0200
changeset 11286 0b38e373b985
parent 11285 581b5b64b382
child 11290 12d226a5bab9
[migration] Drop custom "readfunc" for code.interact in shell As the referenced bug http://bugs.python.org/issue1288615 got fixed in Python 2.6, this is no longer needed. Furthermore the implementation is not Python 3 compatible (raw_input, unicode).
cubicweb/migration.py
--- a/cubicweb/migration.py	Thu Jun 02 09:41:24 2016 +0200
+++ b/cubicweb/migration.py	Thu Jun 02 17:52:43 2016 +0200
@@ -269,10 +269,7 @@
         banner = """entering the migration python shell
 just type migration commands or arbitrary python code and type ENTER to execute it
 type "exit" or Ctrl-D to quit the shell and resume operation"""
-        # give custom readfunc to avoid http://bugs.python.org/issue1288615
-        def unicode_raw_input(prompt):
-            return unicode(raw_input(prompt), sys.stdin.encoding)
-        interact(banner, readfunc=unicode_raw_input, local=local_ctx)
+        interact(banner, local=local_ctx)
         try:
             readline.write_history_file(histfile)
         except IOError: