Rammbock icon indicating copy to clipboard operation
Rammbock copied to clipboard

Rammbock install fails on python3

Open joelwhitehouse opened this issue 8 years ago • 3 comments

Steps to Reproduce

On an ubuntu 16.04 LTS installation, open a console. First run sudo pip3 install robotframework.

Then run sudo pip3 install robotframework-rammbock.

Alternatively, download rammbock version 0.4.0.1 on pypi then run sudo python3 setup.py

Expect

robotframework-rambock should install without error.

Actual

The installation fails with the following outuput:

$ sudo pip3 install robotframework-rammbock                                                                                                                               
Collecting robotframework-rammbock
  Using cached robotframework-rammbock-0.4.0.1.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-5sjki94c/robotframework-rammbock/setup.py", line 6, in <module>
        execfile(join(CURDIR, 'src', 'Rammbock', 'version.py'))
    NameError: name 'execfile' is not defined

Recommended solution

Referring to this question on stack overflow, I was able to resolve this issue by replacing setup.py:6

execfile(join(CURDIR, 'src', 'Rammbock', 'version.py'))

with the following:

filename=join(CURDIR, 'src', 'Rammbock', 'version.py')
exec(compile(open(filename, "rb").read(), filename, 'exec'))

Testing

The discussion on stack overflow suggests that this change is compatible with both python2 and python3. I verified that for both python2 and python3 on my machine using the commands:

sudo python setup.py
sudo python3 setup.py

I'm happy to submit this change as a pull request.

joelwhitehouse avatar Jul 14 '17 19:07 joelwhitehouse

Also stumbled on this one today and would be glad to see it resolved in the repo, as well.

chbndrhnns avatar Aug 14 '17 07:08 chbndrhnns

I hope this gets in soon.

shivakumargn avatar Jul 01 '18 01:07 shivakumargn

I'm also waiting Python 3 support asap.

tapioreijonen avatar Oct 31 '18 12:10 tapioreijonen