[PR #33] [MERGED] Close_pbar needs to be before any print statements #61

Closed
opened 2026-02-27 20:05:13 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/misiektoja/instagram_monitor/pull/33
Author: @tomballgithub
Created: 1/3/2026
Status: Merged
Merged: 1/4/2026
Merged by: @misiektoja

Base: devHead: fix-pbar3


📝 Commits (4)

  • 621cdb3 Close_pbar needs to be before any print statements
  • 4ed3da3 chore: bump version to 2.0.4
  • 4a783f1 chore(release): bump version to 2.0.4 in pyproject.toml
  • 6487172 docs(release-notes): add changes in v2.0.4

📊 Changes

3 files changed (+17 additions, -11 deletions)

View changed files

📝 RELEASE_NOTES.md (+6 -0)
📝 instagram_monitor.py (+10 -10)
📝 pyproject.toml (+1 -1)

📄 Description

I noticed during run-time, not at script startup, that when the pbar is used, it caused something like this. Need to scroll right to see that the "* Followers: reported (187) actual (188). Followings: .,." was on the same line as pbar, and the pbar was shown twice.

With TQDM, there can't be any print statements used or it will mess up the progress bar.
It's why "tqdm.write()" is used when necessary to write something. It preserves the pbar.

The cause was due to the finally statements being used to call close_pbar(), which occurs after other prints/updates.

* Followers: reported (187) actual (188). Followings: reported (4350) actual (4351)
* Followings (4350) actual (4351) saved to file 'X'
* Downloading Followings: ████████████████████████████████████████| 4,351/4,351 [11.3 names/req, reqs=385, mins=35.5, remain=0.0]* Followers: reported (187) actual (188). Followings: reported (4349) actual (4350)
* Followings (4351) actual (4351) saved to file 'X'
* Downloading Followings: ████████████████████████████████████████| 4,351/4,351 [11.3 names/req, reqs=385, mins=35.5, remain=0.0]

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/misiektoja/instagram_monitor/pull/33 **Author:** [@tomballgithub](https://github.com/tomballgithub) **Created:** 1/3/2026 **Status:** ✅ Merged **Merged:** 1/4/2026 **Merged by:** [@misiektoja](https://github.com/misiektoja) **Base:** `dev` ← **Head:** `fix-pbar3` --- ### 📝 Commits (4) - [`621cdb3`](https://github.com/misiektoja/instagram_monitor/commit/621cdb3dddaab678ca7c254cfdd5488e806f1a75) Close_pbar needs to be before any print statements - [`4ed3da3`](https://github.com/misiektoja/instagram_monitor/commit/4ed3da34490e6e086fd2724588eaacf35d63b4f2) chore: bump version to 2.0.4 - [`4a783f1`](https://github.com/misiektoja/instagram_monitor/commit/4a783f161632521e7585e07c98e1c98e061bd1c4) chore(release): bump version to 2.0.4 in pyproject.toml - [`6487172`](https://github.com/misiektoja/instagram_monitor/commit/6487172c76d57cbb3a32065866dededb0ae64821) docs(release-notes): add changes in v2.0.4 ### 📊 Changes **3 files changed** (+17 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `RELEASE_NOTES.md` (+6 -0) 📝 `instagram_monitor.py` (+10 -10) 📝 `pyproject.toml` (+1 -1) </details> ### 📄 Description I noticed during run-time, not at script startup, that when the pbar is used, it caused something like this. Need to scroll right to see that the "* Followers: reported (187) actual (188). Followings: .,." was on the same line as pbar, and the pbar was shown twice. With TQDM, there can't be any print statements used or it will mess up the progress bar. It's why "tqdm.write()" is used when necessary to write something. It preserves the pbar. The cause was due to the finally statements being used to call close_pbar(), which occurs after other prints/updates. ``` * Followers: reported (187) actual (188). Followings: reported (4350) actual (4351) * Followings (4350) actual (4351) saved to file 'X' * Downloading Followings: ████████████████████████████████████████| 4,351/4,351 [11.3 names/req, reqs=385, mins=35.5, remain=0.0]* Followers: reported (187) actual (188). Followings: reported (4349) actual (4350) * Followings (4351) actual (4351) saved to file 'X' * Downloading Followings: ████████████████████████████████████████| 4,351/4,351 [11.3 names/req, reqs=385, mins=35.5, remain=0.0] ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:05:13 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/instagram_monitor#61
No description provided.