Matt Wheeler wrote: > My best guess is some of your code which you haven't shown us is calling > `os.chdir()` and then you're not moving back. > > When I encounter this problem I usually mitigate it using a context manager Or avoid using chdir at all, and use full pathnames to refer to things in other directories. -- Greg