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

Error Handling in rewrite is incorrect. #413

Closed
theGOTOguy opened this issue Jul 23, 2022 · 3 comments
Closed

Error Handling in rewrite is incorrect. #413

theGOTOguy opened this issue Jul 23, 2022 · 3 comments

Comments

@theGOTOguy
Copy link
Contributor

Look at:
https://github.com/theskumar/python-dotenv/blob/master/src/dotenv/main.py#L136

If lines 136, 137 or 140 there are ever hit, an error "local variable 'dest' referenced before assignment" will be thrown, because the dest variable only exists within the scope of the with block above.

theGOTOguy added a commit to theGOTOguy/python-dotenv that referenced this issue Jul 27, 2022
… scope in the error handling portion of rewrite.
@theGOTOguy
Copy link
Contributor Author

Resolved by #414

@theskumar
Copy link
Owner

I had to revert #414 because the test was failing. Do you want to take another stab at it?

@theskumar theskumar reopened this Sep 4, 2022
@theGOTOguy
Copy link
Contributor Author

Looks like it was just a linter error. I submitted a new PR -- #423 should work.

bbc2 pushed a commit to theGOTOguy/python-dotenv that referenced this issue 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 bbc2 closed this as completed in 1ecb57d Nov 11, 2022
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

No branches or pull requests

2 participants