Closed jankatins closed 3 years ago
I ran into this issue too and agree knitpy should always put you back where you executed the code. If all we want to do is put the user back and allow the pypandoc error through we dont even need to catch and reraise, just use a try/finally.
Currently, if you use
Knitpy().render(...)
and an exception is raised (e.g. pandoc can't write to a file because it is opened in the pdf reader), the current working dir is changed to the dir where the pymd file was.Catch the error, change back and reraise?