Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: infinite loop creating empty temp files when file deletion prohibited by ACL #10314

Open
ZoomRmc opened this issue Oct 21, 2024 · 3 comments
Labels

Comments

@ZoomRmc
Copy link

ZoomRmc commented Oct 21, 2024

In an attempt to debug the temporary html file created producing the PDF file, the current working directory permissions were changed to prohibit file deletion. Running

pandoc --pdf-engine typst test.typ -o test.pdf

in this directory starts producing empty temporary files in an infinite loop and requires killing the process. Files are zero-length and of "tmp" extension, meaning it happens before Pandoc is able to write to it and save it.

Related:

  1. feature request: leave temporary file behind with --verbose #2288 needs to be renamed and reopened as examining temporary files is not solved.
  2. The fact that pandoc creates an .html temporary which is in fact a typst template combined with the user-provided typst input is very confusing:
    • Why not use a proper file extension or just omit it? Fixed in 7330ad5
    • Shouldn't direct conversion omit templating altogether? Not sure on this one. duh
  3. Doesn't pandoc attempt to use %TEMP% on Windows? I was under impression it does.

Encountered with Pandoc 3.5 on Windows 10

@ZoomRmc ZoomRmc added the bug label Oct 21, 2024
@jgm
Copy link
Owner

jgm commented Oct 21, 2024

On 3, see #777 for the reason for not using %TEMP%.

On 2, I'm baffled if an .html file is being produced! I would need to see why.

"Shouldn't direct conversion omit templating altogether? Not sure on this one." We need to create a standalone typst file to compile with typst. Doing this involves the template.

On 1, you're right that the method we mentioned for examining temp files doesn't work for e.g. typst, so perhaps we should reopen #2288.

@ZoomRmc
Copy link
Author

ZoomRmc commented Oct 21, 2024

On 2, I'm baffled if an .html file is being produced! I would need to see why.

To be clear, it's just the extension, the contents are correct typst.
You're correct, wasn't thinking straight and forgot it goes through the intermediate representation anyway.

@jgm
Copy link
Owner

jgm commented Oct 21, 2024

https://github.com/jgm/pandoc/blob/main/src/Text/Pandoc/PDF.hs#L482-L485

explains the .html. I guess in the past this function was just used for HTML, and I generalized it without changing the extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants