partitioner icon indicating copy to clipboard operation
partitioner copied to clipboard

Python3 compability issue

Open NeelShah18 opened this issue 6 years ago • 2 comments

I found a couple of errors like urllib2, print and decode which is mix with python3 implementation, but it is python 2 code.

NeelShah18 avatar Oct 30 '18 16:10 NeelShah18

I found an error possible related to this issue. I tried with python 3 in MacOS

leme:test ar$ python
Python 3.7.1 (default, Nov  8 2018, 10:50:24)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from partitioner.tools import partitioner
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ar/Temp/test/venv/lib/python3.7/site-packages/partitioner/tools.py", line 50
    print "specified lengths must be a positive integers!"
                                                         ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("specified lengths must be a positive integers!")?

arademaker avatar Dec 20 '18 16:12 arademaker

@arademaker I suggest you download the git repository and then use my pull request. The author didn't combine my changes to a current version. So, If you want to use in python3, first download the whole repository with pull req. and replace. Then you can easily able to use in python3.

This error happening because in python 3 print must be like print("something") but in python 2 it is like python "something".

If you need help to run in python3, please contact me I will help you with it.

NeelShah18 avatar Dec 20 '18 21:12 NeelShah18