python-dotenv icon indicating copy to clipboard operation
python-dotenv copied to clipboard

Error Handling in rewrite is incorrect.

Open theGOTOguy opened this issue 3 years ago • 3 comments

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 avatar Jul 23 '22 21:07 theGOTOguy

Resolved by https://github.com/theskumar/python-dotenv/pull/414

theGOTOguy avatar Sep 03 '22 23:09 theGOTOguy

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

theskumar avatar Sep 04 '22 06:09 theskumar

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

theGOTOguy avatar Sep 04 '22 07:09 theGOTOguy