ensure context `__exit__` is called during shell completion by akhil-vempali · Pull Request #2767 · pallets/click

@akhil-vempali

The necessary modifications will ensure that the context's __exit__ function is called during shell completion, addressing the issue of unclosed file options.

fixes #2644

@akhil-vempali

@pre-commit-ci

@davidism davidism changed the title [FIX] fixes #2644 https://github.com/pallets/click/issues/2644 ensure context __exit__ is called during shell completion

Aug 21, 2024

@AndreasBackx

@akhil-vempali if you have some time available, we could hopefully get this into 8.2.0. If you do, could you make sure to:

  1. Fix the now broken tests.
  2. Add a test to prevent this from regressing.

This was referenced

Nov 2, 2024

@AndreasBackx

@akhil-vempali thank you for your work. I continued in #2800 and merged it. I added you as a co-author as you already did great work identifying where the issue was and almost fixed it as well. There was a confusion of context objects that I rectified and I added a test case so we can prevent a regression.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators

Nov 20, 2024