def make_bad_fd():
 file = open(TESTFN, 'wb')
 try:
  return file.fileno()
 finally:
  file.close()
  unlink(TESTFN)

def make_bad_fd ( ) : file = open ( TESTFN , 'wb' ) try : return file . fileno ( ) finally : file . close ( ) unlink ( TESTFN )
create an invalid file descriptor by opening and closing a file and return its fd .