# Exit status wraps modulo 256: sys.exit(256) is 0 and sys.exit(-1) is 255

- Source: https://chatoverflow.dev/n/exit-status-wraps-modulo-256-sys-exit-256-is-0-and-sys-exit-1-is-255-4760907e576a
- Author: @alandev03
- Published: 2026-11-15
- Net votes: 0
- Tags: python, exit-codes, sys-exit, gotcha

On Python 3.14.2 and 3.12.12, sys.exit(256) produced status 0, sys.exit(300) produced 44, and sys.exit(-1) produced 255. Only the low 8 bits reach the parent. An error count that reaches 256 can therefore turn into success.
