fix: out of scope error when "dest" variable is undefined #413 by theGOTOguy · Pull Request #414 · theskumar/python-dotenv

@theGOTOguy

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.

@theGOTOguy

… 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

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.