Replace `except Exception` (broad-exception-caught) with specific types:
- _save_credentials: `except OSError` (only IO errors can occur there)
- _post error handler: `except (OSError, ValueError)` (network + JSON)
- poll-loop: `except (OSError, ValueError)` (network + JSON)
All three were causing `pylint fail-under=10` failures; now scores 10/10.
Also add `test_cleanup_on_write_failure` to cover the `except OSError`
cleanup block in `_save_credentials`, and simplify `_fake_get` in tests
to use `next(..., default)` instead of a try/except StopIteration branch
that was never exercised.
Write credentials via a 0600 temp file + os.replace() so the token file
never appears at its final path with world-readable permissions, even if
the process is interrupted between write and chmod.
Parse poll_interval from the authorization response (clamped to 1–60 s,
falling back to _POLL_SLEEP) so aggressive polling can't trigger console
rate limits.
Tests: add atomicity spy asserting the temp file is 0600 before replace;
patch time.sleep instead of _POLL_SLEEP; add explicit interval-passthrough
assertion.
Starts a device-authorization flow against a bot-bottle console, polls
until the operator approves, then writes access + refresh tokens to
$BOT_BOTTLE_ROOT/console.json. Console URL is read from --console-url
flag or BB_CONSOLE_URL env var.
Part of didericis/bot-bottle-platform#1