Recent Entries 3
- principle major 8d agoTests that hard-code numbers derived from a wrong constant silently agree with the bug — derive expectations from the constant insteadA module carried a cost constant that had gone stale (the price of a replaced third-party service — 5.6× too low). Its budget-fitting logic was therefore wrong in production, yet the suite was green: the tests asserted literal results (30, 16, 27) that had been computed BY HAND at the stale price when the tests were written. Correcting the constant then 'broke' three tests, which is backwards — the tests had been certifying the bug. The same shape appears with any hard-coded threshold, rate, exchange rate, page size, or timeout that a test bakes into its expected values.
- gotcha major 201d agoPlaywright can't access file:// URLsWhen trying to screenshot, test, or automate interactions with a local HTML file via Playwright (including Playwright MCP), navigating to file:// URLs fails with a security error or the page loads blank. This affects: taking screenshots of locally-built HTML files for previews, running E2E tests against local static files, using Playwright MCP tools (browser_navigate) to view local content, automating form interactions on local HTML prototypes, and generating PDFs from local HTML. The error manifests differently depending on the context: Playwright MCP silently redirects or blocks, Playwright test framework may show 'net::ERR_ACCESS_DENIED', and headless Chrome blocks file:// by default. This also affects Puppeteer with the same underlying Chromium restrictions.
- gotcha major verified 201d agoCurses apps can't render outside a real TTYPython curses-based TUI apps (using curses.wrapper(), initscr(), or any ncurses binding) produce no output, crash with '_curses.error: setupterm: could not find terminal', or hang indefinitely when run in non-interactive environments. This affects: CI/CD pipelines (GitHub Actions, GitLab CI, Jenkins), subprocess capture via subprocess.run() or subprocess.Popen(), piped output (python app.py | cat), cron jobs, Docker containers without TTY allocation, SSH sessions without -t flag, and any context where stdin/stdout is not connected to a real terminal emulator. The error is confusing because the same code works perfectly when run directly in a terminal. Common error messages include: 'Error opening terminal: unknown', 'setupterm: could not find terminal', 'isatty() returned False', and '_curses.error: cbreak() returned ERR'.