serfend/pydumpck

Bug: Invalid File Path in `handle_pyc_file` Method

Opened this issue · 0 comments

In the handle_pyc_file method of the py_common_dump module, there's an issue with the way the new_file path is being constructed. The current implementation concatenates the output_dir and target_file paths directly, which can result in an invalid path if target_file is an absolute path.

Here's the problematic line of code:

new_file = f'{output_dir}{os.path.sep}{target_file}'

This line should be replaced with:

new_file = os.path.join(output_dir, os.path.basename(target_file))