The guidebook / 181 guides
Developer tools
Code, configuration and workflows. Source-linked checks to help you move forward.
Python Regex Returns Groups Instead of Full Matches: Inspect the Result Shape
Adding parentheses changes findall results or inserts delimiters into split output.
Python SQLite With Block Leaves the Connection Open: Close It Explicitly
A sqlite3 connection still accepts queries after leaving its with block.
ConfigParser Lowercases Keys: Set the Name Transformation Before Reading
Mixed-case INI option names are lowercased when written back.
ConfigParser Rejects a Percent Sign: Choose Literal or Interpolated Values
An INI value containing a percent sign fails when retrieved or assigned.
Python BasicConfig Appears Ignored: Inspect Existing Root Handlers
A later basicConfig call does not apply the expected level or format.
Python List Becomes None After Sort: Separate Mutation From the Return Value
Assigning the result of list.sort loses the list reference.
Python Tuple += Raises but the Inner List Changes: Inspect Partial Mutation
A tuple item augmented assignment raises TypeError after changing its contained list.
Python Matrix Rows Change Together: Build Each Mutable Row Separately
Assigning one cell changes several rows in a list-built matrix.
Python UnboundLocalError After Adding an Assignment: Return State Explicitly
A function can read an outer name until a local assignment changes its scope.
Python Loop Lambdas Return the Last Value: Capture Each Callback’s Input
Callbacks created in a loop return the same value when called later.
Python JSON Changes Integer Keys to Strings: Preserve IDs Without Collisions
Diagnose integer-key lookups after Python JSON round trips, reject duplicate names and choose an explicit ID schema without silently losing records.
Python Popen Timeout: Separate Running Status, Output Collection and Child Cleanup
Distinguish poll from communicate, observe a still-running child after timeout, then collect bounded output from a child your script owns.
Python ZIP Is Larger Than the Source: Check Members, Compression and Output Location
Measure ZIP member sizes and container overhead, then create a verified archive outside the input tree without promising lossless size reduction.
JSON Shows Unicode Escapes: Separate Representation, UTF-8 Bytes and Double Encoding
Round-trip escaped and literal JSON, preserve intentional backslashes, and distinguish a saved UTF-8 file from a second JSON serialization layer.
Zip Strict Checks Too Late for Your Side Effects: Understand Lazy Mismatch Detection
Compare truncation, strict iteration and explicit padding, then choose whether finite inputs must be staged before any writes begin.
Mock Patch Has No Effect: Check the Consumer’s Imported Binding
Compare direct imports and module lookups in an inert three-module fixture, then verify the mock call count and restoration.
Make_archive Puts Files in the Wrong Place: Separate Output Path and Member Root
Compare base_name, root_dir and base_dir with complete ZIP manifests before deciding where an archive is written or how its contents are prefixed.
Bash Loop Runs Once With No Matching Files: Choose Nullglob or an Error
Compare unmatched literal patterns, nullglob, failglob and quoted patterns in empty and nonempty directories before adding file writes.