Skip to content

Remove cleanup working directory changes; always use absolute paths. #252

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

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
None yet
Development

Successfully merging this pull request may close these issues.

1 participant