fix: out of scope error when "dest" variable is undefined #413 by theGOTOguy · Pull Request #414 · theskumar/python-dotenv
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.
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
bbc2 pushed a commit to theGOTOguy/python-dotenv that referenced this pull request
Nov 11, 2022Fixes 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, 2022This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters