baruch / diskscan

Scan disk for bad or near failure sectors, performs disk diagnostics
GNU General Public License v3.0
108 stars 29 forks source link

Python scripts of libscsicmd do not work with Python3 #38

Closed kalimalrazif closed 8 years ago

kalimalrazif commented 9 years ago

I'm trying to make and get this error

do          libscsicmd/include/ata_parse.h
do            ata_struct_2_h.py exists.
do            ata_identify.yaml exists.
  File "../structs/ata_struct_2_h.py", line 12
    """ % bit_params
      ^
SyntaxError: invalid syntax
do:         libscsicmd/include/ata_parse.h: got exit code 1
do:       arch/arch.o: got exit code 1
do:     arch/arch.a: got exit code 1
do:   diskscan: got exit code 1
do: all: got exit code 1
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 1

Using archlinux

Linux echo1 4.1.4-1-ARCH #1 SMP PREEMPT Mon Aug 3 21:30:37 UTC 2015 x86_64 GNU/Linux

Seems to be an python version issue but I cant get it how to correct the issue

Thanks in advance

baruch commented 9 years ago

What is your python version? you can find it with python -V

baruch commented 9 years ago

Make sure that whitespace was not modified in any way and that tabs are kept intact.

kalimalrazif commented 9 years ago

My python version.

python -V
Python 3.4.3

The code was just downloaded and then compiled, no modifications from me

kalimalrazif commented 9 years ago

My python version.

python -V
Python 3.4.3

The code was just downloaded and then compiled, no modifications from me

baruch commented 9 years ago

Can you try python 2.7?

On Sun, Aug 23, 2015, 23:27 Nomar O. Mora T. notifications@github.com wrote:

My python version.

python -V Python 3.4.3

The code was just downloaded and then compiled, no modifications from me

Reply to this email directly or view it on GitHub https://github.com/baruch/diskscan/issues/38#issuecomment-133923834.

kalimalrazif commented 9 years ago

Changing to python 2.7 on script make agagin and did not work :-( but I run the script from command line and work well, there are a central point were the python executable is set?

kalimalrazif commented 9 years ago

Searching found the script ata_parse.h.do call the others scripts via python change to python2 and works now the make stops on

do          smartdb/smartdb_gen.c
do            smartdb_gen_c.py exists.
do            smartdb.xml exists.
  File "smartdb_gen_c.py", line 77
    print '#include "smartdb.h"'
                               ^
SyntaxError: Missing parentheses in call to 'print'

Gonna search for phyton again and change it

kalimalrazif commented 9 years ago

It works, change python to python2 on .do files works.... thanks :-D

baruch commented 9 years ago

I keep this issue as a note that libscsicmd needs to be fixed to work with Python3 as well, I'll see what it takes to make it work in both python versions.

Thanks for helping working out the issue!

baruch commented 8 years ago

Commit 83b968b07580606b0b133ad7fda439a0cd134721 fixes python3 compatibility issues.