Windows uv venv local quarto install has problems with backslashes --- patch included!

Open Beginner friendly
#14,782 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
lua, python
Domain
tooling

Research direction

Review share/filters/main.lua around compileTemplate, then reproduce the failure with a local uv venv on Windows and quarto-cli installed via uv pip. Confirm that a document compiles successfully and that the informative Lua error no longer occurs for paths containing .venv.

Written by the indexing model from the issue text.

Description

bug
I have:
  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide
Bug description
diff --git a/share/filters/main.lua b/share/filters/main.lua
--- a/share/filters/main.lua
+++ b/share/filters/main.lua
@@ -3040,7 +3040,11 @@ function isInlineEl(el)
 end
 
 function compileTemplate(template, meta)
-  local f = io.open(pandoc.utils.stringify(template), "r")
+  template = pandoc.utils.stringify(template)
+  -- Pandoc treats the separator before `.venv` as an escape while parsing
+  -- the title-block attribute on Windows. Restore the resulting missing one.
+  template = template:gsub("([^/\\])%.venv", "%1/.venv")
+  local f = io.open(template, "r")
   if f then
     local contents = f:read("*all")
     f:close()
Steps to reproduce

You create a local uv venv .venv, then install quarto-cli using uv pip install quarto-cli and it won't work unless you use that patch.

Actual behavior

complains about lua code. The error is not informative.

Expected behavior

actually compile a document

Your environment
  • windows 10, powershell 7
Quarto check output
Quarto 1.9.38
[>] Checking environment information...
      Quarto cache location: C:\Users\reckoner\AppData\Local\quarto
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.8.3: OK
      Dart Sass version 1.87.0: OK
      Deno version 2.4.5: OK
      Typst version 0.14.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.9.38
      Path: D:\data_science\.venv\Lib\site-packages\quarto_cli\bin
      CodePage: 1252
[>] Checking tools....................OK
      TinyTeX: v2026.04
      Chromium: (not installed)
      Chrome Headless Shell: (not installed)
      VeraPDF: (not installed)
[>] Checking LaTeX....................OK
      Using: TinyTex
      Path: C:\Users\reckoner\AppData\Roaming\TinyTeX\bin\windows\
      Version: 2026
[>] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
      Source: Windows Registry
[>] Checking basic markdown render....OK
[>] Checking R installation...........(None)
      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/
[>] Checking Python 3 installation....(None)
      Unable to locate an installed version of Python 3.
      Install Python 3 from https://www.python.org/downloads/
[>] Checking Julia installation...
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quarto-dev/quarto-cli

All issues in quarto-dev/quarto-cli

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.