-
Notifications
You must be signed in to change notification settings - Fork 280
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
Fix: pop current directory after chdir. #803
Conversation
b6011d5
to
bc01e17
Compare
Codecov Report
@@ Coverage Diff @@
## main #803 +/- ##
==========================================
+ Coverage 90.75% 90.84% +0.08%
==========================================
Files 78 78
Lines 2164 2162 -2
==========================================
Hits 1964 1964
+ Misses 200 198 -2
Continue to review full report at Codecov.
|
bc01e17
to
4d14da4
Compare
Signed-off-by: dblock <dblock@dblock.org>
4d14da4
to
197d497
Compare
Signed-off-by: dblock <dblock@amazon.com>
093bead
to
2f81c4c
Compare
if chdir: | ||
self.curdir = os.getcwd() | ||
os.chdir(self.name) | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
else: | |
self.curdir = None | |
if chdir: | |
self.curdir = os.getcwd() | |
os.chdir(self.name) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally don't love this because it assigns self.curdir
twice.
Signed-off-by: dblock dblock@dblock.org
Description
On Windows deleting the current directory fails with a "this directory is used by another process" error. Move
chdir
intoTemporaryDirectory
as an option and pop it.Issues Resolved
An error similar to #774 but reproduced more consistently.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.