Skip to content

Commit

Permalink
fix: potential wrong parsing of pip show with multiline string
Browse files Browse the repository at this point in the history
when one of the packages contains license key with multi line string value, it can contains the delimiter "---" inside the value ( that separates between the packages in pip show otuput) , hence need to refine the parsing - that is , refine the delimiter

Signed-off-by: Zvi Grinberg <[email protected]>
  • Loading branch information
zvigrinberg committed Oct 23, 2023
1 parent 09fadb3 commit c708b22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/python_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default class Python_controller {
throw new Error('fail invoking pip show to fetch all installed dependencies metadata --> ' + err.message)
}
}).toString();
let allPipShowDeps = pipShowOutput.split("---");
let allPipShowDeps = pipShowOutput.split( EOL +"---" + EOL);
let linesOfRequirements = fs.readFileSync(this.pathToRequirements).toString().split(EOL).filter( (line) => !line.startsWith("#")).map(line => line.trim())
let CachedEnvironmentDeps = {}
allPipShowDeps.forEach( (record) => {
Expand Down

0 comments on commit c708b22

Please sign in to comment.