{"sha": "37273d7f63f08872aa1c90c4233a0580e384ac19", "message": "Fixed issue #433 - CLI eats cursor (#598)\n\nThe issue is that underlying iterator is not fully consumed within the body of\r\nthe `with file_progress()` block. Instead, that block creates generator\r\nexpressions like `docs = (dict(zip(headers, row)) for row in reader)`\r\n\r\nThese iterables are consumed later, outside the `with file_progress()` block,\r\nwhich consumes the underlying iterator, and in turn updates the progress bar.\r\n\r\nThis means that the `ProgressBar.__exit__` method gets called before the last\r\ntime the `ProgressBar.update` method gets called. The result is that the code to\r\nmake the cursor invisible (inside the `update()` method) is called after the\r\ncleanup code to make it visible (in the `__exit__` method).\r\n\r\nThe fix is to move consumption of the `docs` iterators within the progress bar block.\r\n\r\n(An additional fix, to make ProgressBar more robust against this kind of misuse, would\r\nto make it refusing to update after its `__exit__` method had been called, just\r\nlike files cannot be `read()` after they are closed. That requires a in the\r\nclick library).", "author_date": "2023-11-04T00:40:29Z", "committer_date": "2023-11-04T00:40:29Z", "raw_author": {"value": "189bbd99f415a97bb6554c438654cb35fc4c85ae", "label": "Luke Plant"}, "raw_committer": {"value": "cd792325681cbad9f663f2879d8b69f1edbb678f", "label": "GitHub"}, "repo": {"value": 140912432, "label": "sqlite-utils"}, "author": {"value": 62745, "label": "spookylukey"}, "committer": {"value": 19864447, "label": "web-flow"}}