old_contents: from ._base import Opener
  from ._registry import registry
  
  
  @registry.install
  class SSHOpener(Opener):
      protocols = ['ssh']
  
      @staticmethod
      def open_fs(fs_url, parse_result, writeable, create, cwd):
          from ..sshfs import SSHFS
          ssh_host, _, dir_path = parse_result.resource.partition('/')
          ssh_host, _, ssh_port = ssh_host.partition(':')
          ssh_port = int(ssh_port) if ssh_port.isdigit() else 22
          ssh_fs = SSHFS(
              ssh_host,
              port=ssh_port,
              user=parse_result.username,
              passwd=parse_result.password,
          )
          return ssh_fs.opendir(dir_path) if dir_path else ssh_fs
  
new_contents: from ._base import Opener
  from ._registry import registry
  from ..subfs import ClosingSubFS
  
  @registry.install
  class SSHOpener(Opener):
      protocols = ['ssh']
  
      @staticmethod
      def open_fs(fs_url, parse_result, writeable, create, cwd):
          from ..sshfs import SSHFS
          ssh_host, _, dir_path = parse_result.resource.partition('/')
          ssh_host, _, ssh_port = ssh_host.partition(':')
          ssh_port = int(ssh_port) if ssh_port.isdigit() else 22
          ssh_fs = SSHFS(
              ssh_host,
              port=ssh_port,
              user=parse_result.username,
              passwd=parse_result.password,
          )
          
          if dir_path:
              return ssh_fs.opendir(dir_path, factory=ClosingSubFS)
          else:
              return ssh_fs
  
subject: Fix SSHOpener to use the new ClosingSubFS