Skip to content

Fix Windows path separator regex escaping#211

Open
levnikolaevich wants to merge 1 commit intosourcegraph:scipfrom
levnikolaevich:fix/windows-path-sep-regex
Open

Fix Windows path separator regex escaping#211
levnikolaevich wants to merge 1 commit intosourcegraph:scipfrom
levnikolaevich:fix/windows-path-sep-regex

Conversation

@levnikolaevich
Copy link
Copy Markdown

Summary

Escapes path.sep before using it in new RegExp(...) inside PythonEnvironment.

This fixes a Windows startup crash where path.sep === \ and the current code throws:

Invalid regular expression: /\\/g: \\ at end of pattern

Verification

  • Reproduced on Windows with @sourcegraph/scip-python@0.6.6
  • Verified locally that this patch removes the crash
  • Verified scip-python index completes successfully on a real Python project after the change

Closes #210.

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.

Windows: scip-python crashes on startup due to unescaped path.sep in RegExp

1 participant