Rammbock install fails on python3
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.
Also stumbled on this one today and would be glad to see it resolved in the repo, as well.
I hope this gets in soon.
I'm also waiting Python 3 support asap.