Skip to content

Conversation

@markl-arista
Copy link

The python version detection logic previously searched for "python" in the full path. This failed for paths where a directory name contained "python" (e.g., .../python39/.../libpython3.9.so), causing the parser to misinterpret the version numbers.

Changes:

  • Parsing logic now searches for "python" only in the filename (after the last slash).
  • Extracted parsing logic into getPythonVersionFromFilename for better testability.
  • Improved exception messages to aid debugging.
  • Added tests/python_path_test.cc to verify correct behavior against various path patterns.

Test plan:

mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPYTHON3=ON ..
make -j
make test

The python version detection logic previously searched for "python" in the full
path. This failed for paths where a directory name contained "python" (e.g.,
.../python39/.../libpython3.9.so), causing the parser to misinterpret the version
numbers.

Changes:
 - Parsing logic now searches for "python" only in the filename (after the last
   slash).
 - Extracted parsing logic into getPythonVersionFromFilename for better
   testability.
 - Improved exception messages to aid debugging.
 - Added tests/python_path_test.cc to verify correct behavior against various path
   patterns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant