daff icon indicating copy to clipboard operation
daff copied to clipboard

python-daff is compiled with python2 without good reason

Open uswoods opened this issue 5 years ago • 2 comments

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

uswoods avatar Nov 16 '18 12:11 uswoods

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 avatar Nov 16 '18 20:11 paulfitz

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.

paulfitz avatar Nov 18 '18 01:11 paulfitz