(f)
Pickle a file object.
Pickle a file object.
Pickle a file object .
def pickle_file(f):
    """Pickle a file object."""
    if f in (
            sys.stdout, sys.stdin,
            stdio.stdout, stdio.stdin,
            stdio.stdout.buffer, stdio.stdin.buffer
        ):
        return unpickle_file, (None, f.mode, -1)
    try:
        return unpickle_file, (f.name, f.mode, f.tell())
    except (IOError, ValueError):
        # IOError: not seekable
        # ValueError: closed
        return unpickle_file, (f.name, f.mode, -1)
def pickle_file ( f ) : if f in ( sys . stdout , sys . stdin , stdio . stdout , stdio . stdin , stdio . stdout . buffer , stdio . stdin . buffer ) : return unpickle_file , ( None , f . mode , - 1 ) try : return unpickle_file , ( f . name , f . mode , f . tell ( ) ) except ( IOError , ValueError ) : # IOError: not seekable # ValueError: closed return unpickle_file , ( f . name , f . mode , - 1 )