The example scripts irccat.py and irrcat2.py use sys.stdin.readline() to get their input. However, sys.stdin.readline() also captures the carriage return chracter when the Enter key is pressed when using the script interactively with a command line. It also does this when feeding stdin with a pipe from cat, or using a redirect from a file. Both scripts then choke on these CR characters, and abort with a ValueError exception.
Changing sys.stdin.readline() to sys.stdin.readline().strip() fixes this.