2to3
should not replace white space with tabs so I am guessing that you get a TabError
because those tabs where already present in the code and python 3 does not allow mixing tabs and spaces within a single file whereas that is fine in python 2.
This can be fixed using the reindent.py
script that comes with python and can be found in linux systems under /usr/lib/python2.7/Tools/scripts/reindent.py
or optionally can be installed using pip by pip install reindent
. Then the command to replace tabs with spaces is:
reindent.py file.py