def _headlines(self): yield self.command escape = self._escape for header in (sorted(self.headers.items()) if self.rawHeaders is None else self.rawHeaders): yield ':'.join(escape(textType(field)) for field in header) yield '' yield ''
def _escape(self): return escape(self.version, self.command)