Author Topic: On Linux tridscan.py: error: unrecognized arguments  (Read 652 times)

jenderek

  • Sr. Member
  • ****
  • Posts: 375
On Linux tridscan.py: error: unrecognized arguments
« on: October 03, 2023, 12:15:52 AM »
Hello trid users,

In the past i used the trid utilities on a Windows system. Some weeks i
installed a Linux Mint 21.1. So now i tried to run the trid utilities on this
system. Now i get an error when running a command like:

tridscan.py fr-40-only.cwl fr-60-only.cwl /tmp/spell-mint/fr-80-only.cwl

Then i get an error message like:
usage: tridscan.py [-h] [-v] [-r] [-fs] [-ns] [-d filename] filenames [filenames ...]
tridscan.py: error: unrecognized arguments: /tmp/fr-80-only.cwl

When running the same command without using absolute path in files option by
command like:
tridscan.py fr-40-only.cwl fr-60-only.cwl fr-80-only.cwl

Then all work is OK and i get a message like:
TrIDScan/Py v2.02 - (C) 2015-2016 By M.Pontello
File(s) to scan found: 3
Scanning for patterns...
Checking file 1/3 './fr-80-only.cwl'
Checking file 2/3 './fr-40-only.cwl'
  Pattern(s) found: 95
Checking file 3/3 './fr-60-only.cwl'
  Pattern(s) found: 6
Last pattern end at offset: 1722
Scanning for strings...
Analyzing file 1/3 './fr-80-only.cwl'
  Raw strings: 11K
  String(s) found: 1763     
Analyzing file 2/3 './fr-40-only.cwl'
Parsing...
  Raw strings: 217K
  Checking strings...
  Filtering strings...
  String(s) found: 1366     
Analyzing file 3/3 './fr-60-only.cwl'
Parsing...
  Raw strings: 408K
  Checking strings...
  Filtering strings...
  String(s) found: 1275     
New TrID's definition written as 'newtype.trid.xml'.

So apparently there is a bug in tridscan python script (version 2.02), when
handling the slash character. In the past on my Windows system such an error
did not occur because there the path separating character is a backslash on
such a system.

I also checked the python version by running a command like:
   python2 --version

On Linux Mint and my window systems i get "Python 2.7.18". Then i also
test it on an old SUSE 13.2. There the same error occur for Python
version 2.7.8.

At the moment as a work around i copy my inspected samples in one directory
and in that directory i run tridscan there without leading paths.

But this is annoying when i want to check hundreds of examples laying
around on the disc in many different directories.

According to documentation the program should also work when using path but it
definitively does not in such a case.

I hope this error can be fixed in the future. Regards

Jörg Jenderek

Mark0

  • Administrator
  • Hero Member
  • *****
  • Posts: 2743
    • Mark0's Home Page
Re: On Linux tridscan.py: error: unrecognized arguments
« Reply #1 on: October 05, 2023, 03:08:25 PM »
Thanks, will check out!