BlueprintCoding / SillyTavernSimpleLauncher

A launcher that let's you install, uninstall, update, backup and uninstall SillyTavern and SillyTavernExtras
77 stars 27 forks source link

Path string results in invalid escape sequence '\p' #27

Open Solomon1732 opened 6 months ago

Solomon1732 commented 6 months ago

https://github.com/BlueprintCoding/SillyTavernSimpleLauncher/blob/5e53422fa6e8a9c9834bbb3aacf4aea021c9d177/app.py#L769 https://github.com/BlueprintCoding/SillyTavernSimpleLauncher/blob/5e53422fa6e8a9c9834bbb3aacf4aea021c9d177/app.py#L792 Here is the error:

C:\path\to\STSL\SillyTavernSimpleLauncher\app.py:769: SyntaxWarning: invalid escape sequence '\p'
  main_branch = os.path.join(parent_folder, 'SillyTavern-MainBranch\public')
C:\path\to\STSL\SillyTavernSimpleLauncher\app.py:792: SyntaxWarning: invalid escape sequence '\p'
  dev_branch = os.path.join(parent_folder, 'SillyTavern-DevBranch\public')

The solution is to simply write the following instead of a backwards slash:

main_branch = os.path.join(parent_folder, 'SillyTavern-MainBranch', 'public')

If you're interested in using the pathlib module (from the standard library), then it may be easier to handle files, although YMMV. For one, it uses / for all paths across platforms.