Python Automation Production Failure Patterns
Thirty-seven guides produced a lot of failures, and most of them were the same half dozen shapes: no timeout, no check, a shell where a list would do, a bare except, a credential in the wrong place. This guide collects every one into a single file, runs a linter over it, and counts: 22 findings. Then it fixes them and counts again - and the four mistakes that survive a clean lint report are the point of the page.
Readiness Guide 39 of 39 Advanced
- Control nodeUbuntu 26.04 LTS
- Python3.14.4
- requests2.34.2
- paramiko5.0.0
- TimeAbout 20 min
ruff 0.16.4 with E, F, W, B, S, BLE, PLW, UP, SIM selected. The S rules are flake8-bandit; S603 fires on every subprocess call and does not distinguish a list from a shell string, which is why it needs a deliberate noqa.
- pytest9.1.1
- PyYAML6.0.3
- boto3 / botocore1.43.78
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| RUNNER01 | 192.168.0.27 | Ubuntu 26.04 LTS | Control node - every script in this path runs here | 2 Core | 4 GB | 50 GB |
This guide includes
Use this as the last pass over your own scripts. This matters because a linter catches most of these for nothing - and the four it cannot see are the ones that fail at three in the morning.
- reading one script with every mistake on this path in it
- catching most of them with one config file and one command
- reading five of the rules in full, with the source line and the fix
- meeting the four a linter cannot see
- fixing the script, and counting what is left three ways
Before you start
-
A script with every mistake on this path in it
-
What a linter catches for nothing
-
The ones it explains best
-
And the four it cannot see
-
The same script, fixed - and what is left
-
Four of those six are real
-
The count, three ways