paulfitz / daff

align and compare tables
https://paulfitz.github.io/daff
MIT License
801 stars 67 forks source link

python-daff is compiled with python2 without good reason #130

Open uswoods opened 6 years ago

uswoods commented 6 years ago

On my ArchLinux python(3) is default since years. Anyway the Makefile first demanded 3to2 and then compiled it with 3to2, but later installed installed it with the default python(3).

Executing the py2 code with py3 leads to a crash:

Traceback (most recent call last):
  File "/usr/bin/daff", line 11, in <module>
    load_entry_point('daff==1.3.39', 'console_scripts', 'daff')()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 487, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2728, in load_entry_point
    return ep.load()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2346, in load
    return self.resolve()
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2352, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/bin/daff.py", line 11287
    def get_stdout():\n\treturn (python_lib_Sys.stdout.buffer if hasattr(python_lib_Sys.stdout,"buffer") else python_lib_Sys.stdout)
                                                                                                                                   ^
SyntaxError: unexpected character after line continuation character
paulfitz commented 6 years ago

Thanks. The py2/py3 thing is awkward. If you are using the Makefile, then make py should work with python3 and not mess around with 3to2.

paulfitz commented 6 years ago

Hmm from the snippet you posted, it looks like an echo command in the Makefile is being expanded a bit differently for you than it is for me. That "\n\t" needs to end up being a newline followed by a tab.