docs: def _EnvOpen(var, mode):
    """Open a file descriptor identified by an environment variable."""
    value = os.getenv(var)
    if value is None:
      raise ValueError("%s is not set" % var)
  
    fd = int(value)
  
    # If running on Windows, convert the file handle to a C file descriptor; see:
    # https://groups.google.com/forum/#!topic/dev-python/GeN5bFJWfJ4
    if _WINDOWS:
      fd = msvcrt.open_osfhandle(fd, 0)
  
    return os.fdopen(fd, mode)