ghantoos / lshell

lshell is a shell coded in Python, that lets you restrict a user's environment to limited sets of commands, choose to enable/disable any command over SSH (e.g. SCP, SFTP, rsync, etc.), log user's commands, implement timing restriction, and more.
GNU General Public License v3.0
436 stars 111 forks source link

Setup.py not working with recent python? #80

Closed xlr-8 closed 10 years ago

xlr-8 commented 10 years ago

Apparently the setup.py does not work with newest version of python (here 3.4.1)

> python --version
Python 3.4.1

> sudo ./setup.py install
running install
running build
running build_py
running build_scripts
running install_lib
creating /usr/lib/python3.4/site-packages/lshell
copying build/lib/lshell/__init__.py -> /usr/lib/python3.4/site-packages/lshell
copying build/lib/lshell/shellcmd.py -> /usr/lib/python3.4/site-packages/lshell
copying build/lib/lshell/utils.py -> /usr/lib/python3.4/site-packages/lshell
copying build/lib/lshell/checkconfig.py -> /usr/lib/python3.4/site-packages/lshell
byte-compiling /usr/lib/python3.4/site-packages/lshell/__init__.py to __init__.cpython-34.pyc
byte-compiling /usr/lib/python3.4/site-packages/lshell/shellcmd.py to shellcmd.cpython-34.pyc
  File "/usr/lib/python3.4/site-packages/lshell/shellcmd.py", line 259
    except OSError, (ErrorNumber, ErrorMessage):
                  ^
SyntaxError: invalid syntax

byte-compiling /usr/lib/python3.4/site-packages/lshell/utils.py to utils.cpython-34.pyc
  File "/usr/lib/python3.4/site-packages/lshell/utils.py", line 29
    except Exception,e:
                    ^
SyntaxError: invalid syntax

byte-compiling /usr/lib/python3.4/site-packages/lshell/checkconfig.py to checkconfig.cpython-34.pyc
  File "/usr/lib/python3.4/site-packages/lshell/checkconfig.py", line 225
    ConfigParser.ParsingError), argument:
                              ^
SyntaxError: invalid syntax

running install_scripts
copying build/scripts-3.4/lshell -> /usr/bin
changing mode of /usr/bin/lshell to 755
running install_data
copying etc/lshell.conf -> /etc
copying etc/logrotate.d/lshell -> /etc/logrotate.d
creating /usr/share/doc/lshell
copying README.md -> /usr/share/doc/lshell
copying COPYING -> /usr/share/doc/lshell
copying CHANGES -> /usr/share/doc/lshell
copying man/lshell.1 -> /usr/share/man/man1/
running install_egg_info
Writing /usr/lib/python3.4/site-packages/lshell-0.9.16-py3.4.egg-info

Switching back to python 2.7 solved the issue though:

>sudo python2.7 ./setup.py install
running install
running build
running build_py
running build_scripts
creating build/scripts-2.7
copying and adjusting bin/lshell -> build/scripts-2.7
changing mode of build/scripts-2.7/lshell from 644 to 755
running install_lib
creating /usr/lib/python2.7/site-packages/lshell
copying build/lib/lshell/__init__.py -> /usr/lib/python2.7/site-packages/lshell
copying build/lib/lshell/shellcmd.py -> /usr/lib/python2.7/site-packages/lshell
copying build/lib/lshell/utils.py -> /usr/lib/python2.7/site-packages/lshell
copying build/lib/lshell/checkconfig.py -> /usr/lib/python2.7/site-packages/lshell
byte-compiling /usr/lib/python2.7/site-packages/lshell/__init__.py to __init__.pyc
byte-compiling /usr/lib/python2.7/site-packages/lshell/shellcmd.py to shellcmd.pyc
byte-compiling /usr/lib/python2.7/site-packages/lshell/utils.py to utils.pyc
byte-compiling /usr/lib/python2.7/site-packages/lshell/checkconfig.py to checkconfig.pyc
running install_scripts
copying build/scripts-2.7/lshell -> /usr/bin
changing mode of /usr/bin/lshell to 755
running install_data
running install_egg_info
Writing /usr/lib/python2.7/site-packages/lshell-0.9.16-py2.7.egg-info

Cheers

ghantoos commented 10 years ago

lshell has not yet been ported to python3. This work will be done in time. :)

Closing this issue for now.