Output binary data from CGI in Python 3

This question is related to this one. I was having no problems while printing raw binary data from a CGI script in Python 2, for example: #!/usr/bin/env python2 import os if __name__ == '__main_...