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

Unable to delete temp files on Windows #35

Open
i-d-lytvynenko opened this issue Jan 9, 2024 · 0 comments
Open

Unable to delete temp files on Windows #35

i-d-lytvynenko opened this issue Jan 9, 2024 · 0 comments

Comments

@i-d-lytvynenko
Copy link

When closing .ipynb files on Win 10, the plugin fails to delete the generated .md files. You can see the redacted log below:

DBG: filename: C:\path\to\file.ipynb
DBG: filename exists: 1
DBG: jupytext_file: C:\path\to\file.md
DBG: jupytext_file exists: 0
DBG: Generate file C:\path\to\file.md
DBG: cmd: jupytext --to=md --output="C:\path\to\file.md" "C:\path\to\file.ipynb"
DBG: [jupytext] Reading C:\path\to\file.ipynb in format ipynb^@[jupytext] Writing 'C:\path\to\file.md'
DBG: read C:\path\to\file.md
DBG: autocmd jupytext_ipynb BufUnload <buffer> call s:cleanup("C:\path\to\file.md", 1)
DBG: autocmd jupytext_ipynb BufWriteCmd,FileWriteCmd <buffer> call s:write_to_ipynb()
DBG: filetype: markdown
DBG: a:jupytext_file:C:pathtofile.md
DBG: deleting C:pathtofile.md

This happens because of the double quotes in s:cleanup("C:\path\to\file.md", 1): backslash is treated as an escape symbol. If there is no particular reason to use double quotes instead of single ones, changing 2 lines of code will solve the problem (at least it did for me).

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

No branches or pull requests

1 participant