Skip to content

Conversation

cgevans
Copy link

@cgevans cgevans commented Aug 6, 2025

The cleanup routines, and some other locations, relied on persistent changes to the working directory despite being in the context of yields where other changes might take place. This may be at fault for #249, for example, and generally seems unsafe.

In an attempt to prevent the working directory from being a problem, this PR removes all os.chdir calls. It instead passes paths between methods, making them absolute on the first opportunity, and sets the working directories of subprocesses at the point of starting them. The cleanup mechanism still feels risky – it would be safer to restrict removals to a set of plausible temporary file patterns – but this should at least make things a bit safer, and doesn't involve needing to choose that set yet; I might try to come up with that later if I have time.

I'm leaving this as a draft until I can test it.

@github-actions
Copy link

github-actions bot commented Aug 6, 2025

Binder 👈 Launch a Binder on branch cgevans/jupyterlab-latex/master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant