[Python-modules-team] Bug#843793: "ipython -c" fails when there are spaces in commands

Younes Khoudli younes.khoudli at gmail.com
Wed Nov 9 16:49:18 UTC 2016


Package: ipython
Version: 5.1.0-2
Package: ipython3
Version: 5.1.0-2

Expected behaviour :

$ ipython -c 'print 42'
42
$ ipython3 -c 'print ( 42 ) '
42
$ ipython3 -c 'print(42)'
42

Actual behaviour:

$ ipython -c 'print 42'

$ ipython3 -c 'print ( 42 ) '
Out[1]: <function print>
$ ipython3 -c 'print(42)'
42

Seems like the wrapper scripts /usr/bin/ipython and /usr/bin/ipython3
don't quote their arguments when calling ipython.

Suggested patch:

--- /usr/bin/ipython    2016-10-31 08:47:51.000000000 +0100
+++ ./ipython    2016-11-09 16:51:36.107602731 +0100
@@ -7,5 +7,5 @@
     echo "Please install the python$VERSION package." >&2
     exit 1
 else
-    exec python$VERSION -c "import sys; sys.argv[0] =
'/usr/bin/ipython$VERSION'; from IPython.terminal.ipapp import
launch_new_instance; launch_new_instance()" $@
+    exec python$VERSION -c "import sys; sys.argv[0] =
'/usr/bin/ipython$VERSION'; from IPython.terminal.ipapp import
launch_new_instance; launch_new_instance()" "$@"
 fi



More information about the Python-modules-team mailing list