Skip to content
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: out of scope error when "dest" variable is undefined #413 #414

Merged
merged 1 commit into from Sep 3, 2022

Conversation

theGOTOguy
Copy link
Contributor

I just changed the with block to dest = ... since delete=False was preventing it from being cleaned up anyway, and then set a default value for dest in case an error happens earlier.

… scope in the error handling portion of rewrite.
@theskumar theskumar changed the title Fixes #413, whereby the NamedTemporaryFile "dest" was out of scope in the error handling portion of rewrite. fix: out of scope error when "dest" variable is undefined #413 Sep 3, 2022
@theskumar theskumar merged commit a53d652 into theskumar:master Sep 3, 2022
@theskumar
Copy link
Owner

Thanks, @theGOTOguy, for the fix!

@theGOTOguy theGOTOguy deleted the fix-dest-out-of-scope branch September 3, 2022 23:59
@theGOTOguy theGOTOguy restored the fix-dest-out-of-scope branch September 4, 2022 07:02
bbc2 pushed a commit to theGOTOguy/python-dotenv that referenced this pull request Nov 11, 2022
Fixes theskumar#413 whereby the NamedTemporaryFile "dest" was out of scope in the
error handling portion of rewrite.

The problem was initially fixed in theskumar#414 but it got reverted because of a
linter error. This new commit works around that linter error.
bbc2 pushed a commit that referenced this pull request Nov 11, 2022
Fixes #413 whereby the NamedTemporaryFile "dest" was out of scope in the
error handling portion of rewrite.

The problem was initially fixed in #414 but it got reverted because of a
linter error. This new commit works around that linter error.
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.

None yet

2 participants