Reverting one of those irritating "security fixes". fdopen() opens
files in binary mode. That makes pydoc skip the \r\n on Windows that's
need to make the output readable in the shell. Screw it.
def tempfilepager(text, cmd):
"""Page through text by invoking a program on a temporary file."""
import tempfile
- (fd, filename) = tempfile.mkstemp()
- file = os.fdopen(fd, 'w')
+ filename = tempfile.mktemp()
+ file = open(filename, 'w')
file.write(text)
file.close()
try: