the conditional for self.debug could never be reached here since debug=True prevented execution from entering the write functions