web2py-ipython shell error: "list index out of range"

87 views
Skip to first unread message

Jose C

unread,
Jul 7, 2018, 10:19:24 AM7/7/18
to web2py-users

Greetings,

In a new virtual environment using Python3's built-in venv functionality, with IPython installed and latest web2py source. When dropping into a web2py-ipython shell, starting ipython throws a "list index out of range" exception and the shell defaults to interactive. Steps to reproduce below.

jose@VM-ubu1804x64:~/python-environments$ python3 -m venv w2p_test

jose@VM
-ubu1804x64:~/python-environments$ workon w2p_test
(w2p_test) jose@VM-ubu1804x64:~/python-environments$ pip3 install ipython
(w2p_test) jose@VM-ubu1804x64:~/python-environments$ ipython
Python 3.6.5 (default, Apr  1 2018, 05:46:30)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]:
Do you really want to exit ([y]/n)? y

(w2p_test) jose@VM-ubu1804x64:~/python-environments/w2p_test/lib/web2py$ python web2py.py -S welcome
web2py
Web Framework
Created by Massimo Di Pierro, Copyright 2007-2018
Version 2.16.1-stable+timestamp.2018.06.02.04.50.21
Database drivers available: sqlite3, imaplib, pymysql
WARNING:web2py:import IPython error; use default python shell.  Exception was: list index out of range   <-- I edited line 329 of gluon/shell.py to display the Exception thrown here.
Python 3.6.5 (default, Apr  1 2018, 05:46:30)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>


*** System specs...
System: Ubuntu Mate 18.04 (x64) running in Virtualbox VM
Python version:  3.6.5
web2py latest available download source (for testers):   Version 2.16.1-stable+timestamp.2018.06.02.04.50.21
IPython version installed: 6.4.0


I am able to reproduce this consistently with steps above.  Can anyone else reproduce the error as well (so I can rule out an environment problem) in which case I can file an official bug report if necessary?

Many thanks,

Jose

黄祥

unread,
Jul 7, 2018, 8:58:44 PM7/7/18
to web2py-users
tested on docker with ubuntu image no problem with python 2 and python 3
e.g.
python 2 docker ubuntu image
docker pull ubuntu
docker run
-it ubuntu /bin/bash

apt update
apt install
-y  python-pip unzip wget
pip install ipython
wget
-c http://web2py.com/examples/static/web2py_src.zip
unzip
-o web2py_src.zip

root@44b18a5a6a7a
:/# ipython
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
Type "copyright", "credits" or "license" for more information.

IPython 5.7.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.


In [1]:
Do you really want to exit ([y]/
n)?
root@44b18a5a6a7a
:/# web2py/web2py.py -S welcome
web2py
Web Framework

Created by Massimo Di Pierro, Copyright 2007-2018
Version 2.16.1-stable+timestamp.2017.11.14.05.54.25
Database drivers available: sqlite3, imaplib, pymysql, pg8000
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
Type "copyright", "credits" or "license" for more information.

IPython 5.7.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python'
s own help system.
object?   -> Details about 'object', use 'object??' for extra details.


python 3 docker ubuntu image
docker pull ubuntu
docker run
-it ubuntu /bin/bash

apt update
apt install
-y  python3-pip unzip wget
pip3 install ipython
wget
-c http://web2py.com/examples/static/web2py_src.zip
unzip
-o web2py_src.zip

root@44b18a5a6a7b
:/# ipython

Python 3.6.5 (default, Apr  1 2018, 05:46:30)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]:
Do you really want to exit ([y]/
n)?
root@44b18a5a6a7b
:/# python3 web2py/web2py.py -S welcome
web2py
Web Framework

Created by Massimo Di Pierro, Copyright 2007-2018
Version 2.16.1-stable+timestamp.2017.11.14.05.54.25
Database drivers available: sqlite3, imaplib, pymysql, pg8000
Python 3.6.5 (default, Apr  1 2018, 05:46:30)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.

best regards,
stifan


Jose C

unread,
Jul 8, 2018, 7:05:52 AM7/8/18
to web2py-users
Hi Stifan,


Many thanks for checking. I noticed you used the stable version: 2.16.1-stable+timestamp.2017.11.14.05.54.25. I was using the latest nightly: 2.16.1-stable+timestamp.2018.06.02.04.50.21

I tested with the stable version you used and it works fine here too. This implies that a bug may have been introduced into the newer versions.

Can I ask you to please re-run your test for confirmation with the nightly version at: https://mdipierro.pythonanywhere.com/examples/static/nightly/web2py_src.zip

Thanks,
Jose


黄祥

unread,
Jul 8, 2018, 7:41:59 AM7/8/18
to web2py-users
yes, have the same error too on docker, not sure on line 329, i've checked it shown:
'import IPython error; use default python shell')

step to reproduce an error on docker
python 2 docker ubuntu image with web2py nightly source
docker pull ubuntu
docker run
-it ubuntu /bin/bash

apt update
apt install
-y  python-
pip unzip wget
pip install ipython
wget
-c https://mdipierro.pythonanywhere.com/examples/static/nightly/web2py_src.zip
unzip
-o web2py_src.zip

root@c989eef9003b
:/# ipython

Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
Type "copyright", "credits" or "license" for more information.

IPython 5.7.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]:
Do you really want to exit ([y]/
n)?
root@c989eef9003b
:/# web2py/web2py.py -S welcome
web2py
Web Framework

Created by Massimo Di Pierro, Copyright 2007-2018
Version 2.16.1-stable+timestamp.2018.06.02.04.50.21
Database drivers available: sqlite3, imaplib, pymysql
WARNING
:web2py:import IPython error; use default python shell
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>

python 3 docker ubuntu image with web2py nightly source
docker pull ubuntu
docker run
-it ubuntu /bin/bash

apt update
apt install
-y  python3-
pip unzip wget
pip3 install ipython
wget
-c https://mdipierro.pythonanywhere.com/examples/static/nightly/web2py_src.zip
unzip
-o web2py_src.zip

root@9454510a3068
:/# ipython

Python 3.6.5 (default, Apr  1 2018, 05:46:30)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]:
Do you really want to exit ([y]/
n)?
root@9454510a3068
:/# python3 web2py/web2py.py -S welcome
web2py
Web Framework

Created by Massimo Di Pierro, Copyright 2007-2018
Version 2.16.1-stable+timestamp.2018.06.02.04.50.21
Database drivers available: sqlite3, imaplib, pymysql
WARNING
:web2py:import IPython error; use default python shell
Python 3.6.5 (default, Apr  1 2018, 05:46:30)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>

best regards,
stifan

Jose C

unread,
Jul 8, 2018, 9:08:50 AM7/8/18
to web...@googlegroups.com
Great Stifan,  thanks for confirming.  I'll file a bug report with the dev team.

Regards,
Jose



Reply all
Reply to author
Forward
0 new messages