Skip to content

Commit 70d1894

Browse files
fix(build): fix Python interpreter calling failure when path contains spaces (#18210)
Link to issue number: None Summary of the issue: On systems where the build directory contains spaces (e.g., under "My Codes"), NVDA's build process fails due to unquoted executable paths. Previously, this was addressed for m4.exe (see #18147) but Python interpreter paths used during SCons builds (such as for building user_docs) were not properly quoted, causing continued failures in similar scenarios. Description of user facing changes: None Description of developer facing changes: The build system SCons invokes the Python interpreter (e.g., @{sys.executable} in building scripts) in several build steps. When the interpreter’s path contains spaces (e.g., in "C:\Users\MyName\Documents\My Codes\nvda\.venv\Scripts\python.exe"), the command fails unless the path is wrapped in quotes. This PR wraps {sys.executable} in double quotes to ensure these paths are parsed correctly by the shell and avoids build errors in such environments.
1 parent 6255fec commit 70d1894

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

projectDocs/dev/developerGuide/sconscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ mdFileSub = env.Substfile(
2424
htmlFile = env.Command(
2525
target=mdFile.abspath.replace(".md", ".html"),
2626
source=mdFileSub,
27-
action=[f'@{sys.executable} source/md2html.py -t developerGuide "$SOURCE" "$TARGET"'],
27+
action=[f'@"{sys.executable}" source/md2html.py -t developerGuide "$SOURCE" "$TARGET"'],
2828
)
2929
devGuide = env.Command(
3030
target=devDocsOutputDir.File("developerGuide.html"), source=htmlFile, action=Move("$TARGET", "$SOURCE")

sconstruct

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ for xliffFile in env.Glob(os.path.join(userDocsDir.path, "*", "*.xliff")):
307307
env.Command(
308308
mdFile,
309309
xliffFile,
310-
[f'@{sys.executable} source/markdownTranslate.py generateMarkdown -x "{xliffFile}" -o "{mdFile}"'],
310+
[f'@"{sys.executable}" source/markdownTranslate.py generateMarkdown -x "{xliffFile}" -o "{mdFile}"'],
311311
)
312312
# Allow all markdown files to be converted to html in user_docs
313313
for mdFile in env.Glob(os.path.join(userDocsDir.path, "*", "*.md")):
@@ -326,7 +326,7 @@ for mdFile in env.Glob(os.path.join(userDocsDir.path, "*", "*.md")):
326326
htmlFile = env.Command(
327327
target=mdFile.abspath.replace(".md", ".html"),
328328
source=mdFileSub,
329-
action=[f'@{sys.executable} source/md2html.py -l {lang} -t {docType} "$SOURCE" "$TARGET"'],
329+
action=[f'@"{sys.executable}" source/md2html.py -l {lang} -t {docType} "$SOURCE" "$TARGET"'],
330330
)
331331
styleInstallPath = os.path.dirname(mdFile.abspath)
332332
installedStyle = env.Install(styleInstallPath, styles)
@@ -351,7 +351,7 @@ for userGuideFileSub in env.Glob(os.path.join(userDocsDir.path, "*", "userGuide.
351351
keyCommandsHtmlFile = env.Command(
352352
target=userGuideFileSub.abspath.replace("userGuide.md.sub", "keyCommands.html"),
353353
source=userGuideFileSub,
354-
action=[f'@{sys.executable} source/md2html.py -l {lang} -t keyCommands "$SOURCE" "$TARGET"'],
354+
action=[f'@"{sys.executable}" source/md2html.py -l {lang} -t keyCommands "$SOURCE" "$TARGET"'],
355355
)
356356
env.Depends(keyCommandsHtmlFile, userGuideFileSub)
357357

0 commit comments

Comments
 (0)