ham-radio-software / D-Rats

D-Rats program for D-Star Ham Radios
https://iz2lxi.jimdofree.com/
Other
41 stars 12 forks source link

Version.py regression? and other errors, not sure #245

Closed KP4AJ closed 10 months ago

KP4AJ commented 10 months ago

Hi John: I figured out how to use MSYS2! Now can test code more frequently. If I did not make a mistake when cloning git, I am getting there errors when trying to run D-rats (latest code): $ python d-rats.py Traceback (most recent call last): File "C:/Users/Edfel/D-Rats/d-rats.py", line 37, in from d_rats.version import version File "C:/Users/Edfel/D-Rats/d_rats/version.py", line 400, in DRATS_VERSION_NUM = GLOBAL_VERSION.short_version ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:/Users/Edfel/D-Rats/d_rats/version.py", line 111, in short_version self._get_short_version() File "C:/Users/Edfel/D-Rats/d_rats/version.py", line 98, in _get_short_version cls._get_version() File "C:/Users/Edfel/D-Rats/d_rats/version.py", line 364, in _get_version raw_version = subprocess.check_output(cmd).decode().strip() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:/msys64/mingw64/lib/python3.11/subprocess.py", line 466, in check_output return run(popenargs, stdout=PIPE, timeout=timeout, check=True, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:/msys64/mingw64/lib/python3.11/subprocess.py", line 548, in run with Popen(popenargs, **kwargs) as process: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:/msys64/mingw64/lib/python3.11/subprocess.py", line 1026, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:/msys64/mingw64/lib/python3.11/subprocess.py", line 1538, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [WinError 2] The system cannot find the file specified

Previous to latest changes I had D-Rats working from MSYS2 nicely. Windows 10 64bit, will test Ubuntu tomorrow.

Be safe!

Edfel KP4AJ

wb8tyw commented 10 months ago

From msys2 can use issue the command: git describe --tags --dirty

The error message is that the git command is missing on that system, and this exception is not being handled as I did not test in on a system with out git installed.

wb8tyw commented 10 months ago

Line 368 needs to be changed to: except (FileNotFoundError, subprocess.CalledProcessError):

This will show up in a future pull request / patch to D-Rats.

KP4AJ commented 10 months ago

Thanks John! Confirmed this solved the problem.