docs: def launch_editor(ctx, file):
      """launch editor with decrypted password database"""
      # do not use EDITOR environment variable (rather force user to make a concious choice)
      editor = os.environ.get("PW_EDITOR")
      if not editor:
          click.echo("error: no editor set in PW_EDITOR environment variables")
          ctx.exit(1)
  
      # verify that database file is present
      if not os.path.exists(file):
          click.echo("error: password store not found at '%s'" % file, err=True)
          ctx.exit(1)
  
      # load source (decrypting if necessary)
      is_encrypted = _gpg.is_encrypted(file)
      if is_encrypted:
          original = _gpg.decrypt(file)
      else:
          original = open(file, "rb").read()
  
      # if encrypted, determine recipient
      if is_encrypted:
          recipient = os.environ.get("PW_GPG_RECIPIENT")
          if not recipient:
              click.echo(
                  "error: no recipient set in PW_GPG_RECIPIENT environment variables"
              )
              ctx.exit(1)
  
      # launch the editor
      ext = _gpg.unencrypted_ext(file)
      modified = click.edit(
          original.decode("utf-8"), editor=editor, require_save=True, extension=ext
      )
      if modified is None:
          click.echo("not modified")
          return
      modified = modified.encode("utf-8")
  
      # not encrypted? simply overwrite file
      if not is_encrypted:
          with open(file, "wb") as fp:
              fp.write(modified)
          return
  
      # otherwise, the process is somewhat more complicated
      _gpg.encrypt(recipient=recipient, dest_path=file, content=modified)