rnp icon indicating copy to clipboard operation
rnp copied to clipboard

Non-portable paths in rnp client tests (Python)

Open maxirmx opened this issue 1 year ago • 0 comments

Current state and the issue

gpg built for Msys environment 'understands' MSys paths only, i.e.: '''C:\Program Files\PostgreSQL\12''' shall be ```/c/Program Files/PostgreSQL/12/'''

gpg build for Windows environment works with true Windows paths only, i.e.: C:/Program Files/PostgreSQL/12/''' shall be C:\Program Files\PostgreSQL\12''' (most of Windows programs allow to mix forward and back slashes, but not gpg)

rnp client tests (Python) include multiple definitions like

 ret, _, _ = run_proc(RNPK, ['--import', data_path('test_key_edge_cases/key-eddsa-small-x-pub.asc')])

that create Unix-style paths' fragments on Windows that

  1. forces to use MSys environment even for native Windows tests
  2. makes it practically impossible to use debugger in Windows environment

Proposed fix

 ret, _, _ = run_proc(RNPK, ['--import', data_path('test_key_edge_cases/key-eddsa-small-x-pub.asc')])

shall be

 ret, _, _ = run_proc(RNPK, ['--import', data_path(os.path.join('test_key_edge_cases', 'key-eddsa-small-x-pub.asc')])

(~50 locations)

maxirmx avatar Nov 17 '23 14:11 maxirmx