juftin / browsr

🗂️ a pleasant file explorer in your terminal supporting all filesystems
http://juftin.com/browsr/
MIT License
225 stars 13 forks source link

ftp: `530 Sorry, you have exceeded the number of connections.` #26

Open ap-- opened 10 months ago

ap-- commented 10 months ago

Hello @juftin

When running:

browsr ftp://ftp.ncbi.nih.gov/snp/archive

and navigating down the folder trees, I get the following error:

❯ browsr ftp://ftp.ncbi.nih.gov/snp/archive
╭───────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────╮
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/site-packages/textual/worker.py:363 in _run                           │
│                                                                                                                                      │
│   360 │   │   self.state = WorkerState.RUNNING                                                                                       │
│   361 │   │   app.log.worker(self)                                                                                                   │
│   362 │   │   try:                                                                                                                   │
│ ❱ 363 │   │   │   self._result = await self.run()                                                                                    │
│   364 │   │   except asyncio.CancelledError as error:                                                                                │
│   365 │   │   │   self.state = WorkerState.CANCELLED                                                                                 │
│   366 │   │   │   self._error = error                                                                                                │
│                                                                                                                                      │
│ ╭─────────────────────────────────────────────────── locals ────────────────────────────────────────────────────╮                    │
│ │   app = Browsr(title='browsr', classes={'-show-tree', '-dark-mode'})                                          │                    │
│ │ error = error_perm('530 Sorry, you have exceeded the number of connections.')                                 │                    │
│ │  self = <Worker                                                                                               │                    │
│ │         │   ERROR                                                                                             │                    │
│ │         │   name='_load_directory'                                                                            │                    │
│ │         │   description="_load_directory(TreeNode('JSON', DirEntry(path=UPath('ftp://ftp.ncbi.nih.gov/snp"+36 │                    │
│ │         >                                                                                                     │                    │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                    │
│                                                                                                                                      │
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/site-packages/textual/worker.py:347 in run                            │
│                                                                                                                                      │
│   344 │   │   Returns:                                                                                                               │
│   345 │   │   │   Return value of the work.                                                                                          │
│   346 │   │   """                                                                                                                    │
│ ❱ 347 │   │   return await (                                                                                                         │
│   348 │   │   │   self._run_threaded() if self._thread_worker else self._run_async()                                                 │
│   349 │   │   )                                                                                                                      │
│   350                                                                                                                                │
│                                                                                                                                      │
│ ╭─────────────────────────────────────────────────── locals ───────────────────────────────────────────────────╮                     │
│ │ self = <Worker                                                                                               │                     │
│ │        │   ERROR                                                                                             │                     │
│ │        │   name='_load_directory'                                                                            │                     │
│ │        │   description="_load_directory(TreeNode('JSON', DirEntry(path=UPath('ftp://ftp.ncbi.nih.gov/snp"+36 │                     │
│ │        >                                                                                                     │                     │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                     │
│                                                                                                                                      │
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/site-packages/textual/worker.py:317 in _run_threaded                  │
│                                                                                                                                      │
│   314 │   │   else:                                                                                                                  │
│   315 │   │   │   raise WorkerError("Unsupported attempt to run a thread worker")                                                    │
│   316 │   │                                                                                                                          │
│ ❱ 317 │   │   return await asyncio.get_running_loop().run_in_executor(                                                               │
│   318 │   │   │   None, runner, self._work                                                                                           │
│   319 │   │   )                                                                                                                      │
│   320                                                                                                                                │
│                                                                                                                                      │
│ ╭─────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────╮            │
│ │ run_awaitable = <function Worker._run_threaded.<locals>.run_awaitable at 0x1262ff520>                                 │            │
│ │  run_callable = <function Worker._run_threaded.<locals>.run_callable at 0x1262ffd90>                                  │            │
│ │ run_coroutine = <function Worker._run_threaded.<locals>.run_coroutine at 0x1262fee60>                                 │            │
│ │        runner = <function Worker._run_threaded.<locals>.run_callable at 0x1262ffd90>                                  │            │
│ │          self = <Worker                                                                                               │            │
│ │                 │   ERROR                                                                                             │            │
│ │                 │   name='_load_directory'                                                                            │            │
│ │                 │   description="_load_directory(TreeNode('JSON', DirEntry(path=UPath('ftp://ftp.ncbi.nih.gov/snp"+36 │            │
│ │                 >                                                                                                     │            │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯            │
│                                                                                                                                      │
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/concurrent/futures/thread.py:58 in run                                │
│                                                                                                                                      │
│    55 │   │   │   return                                                                       ╭── locals ───╮                       │
│    56 │   │                                                                                    │ self = None │                       │
│    57 │   │   try:                                                                             ╰─────────────╯                       │
│ ❱  58 │   │   │   result = self.fn(*self.args, **self.kwargs)                                                                        │
│    59 │   │   except BaseException as exc:                                                                                           │
│    60 │   │   │   self.future.set_exception(exc)                                                                                     │
│    61 │   │   │   # Break a reference cycle with the exception 'exc'                                                                 │
│                                                                                                                                      │
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/site-packages/textual/worker.py:302 in run_callable                   │
│                                                                                                                                      │
│   299 │   │   def run_callable(work: Callable[[], ResultType]) -> ResultType:                                                        │
│   300 │   │   │   """Set the active worker, and call the callable."""                                                                │
│   301 │   │   │   active_worker.set(self)                                                                                            │
│ ❱ 302 │   │   │   return work()                                                                                                      │
│   303 │   │                                                                                                                          │
│   304 │   │   if (                                                                                                                   │
│   305 │   │   │   inspect.iscoroutinefunction(self._work)                                                                            │
│                                                                                                                                      │
│ ╭───────────────────────────────────────────────────────────── locals ─────────────────────────────────────────────────────────────╮ │
│ │ self = <Worker                                                                                                                   │ │
│ │        │   ERROR                                                                                                                 │ │
│ │        │   name='_load_directory'                                                                                                │ │
│ │        │   description="_load_directory(TreeNode('JSON', DirEntry(path=UPath('ftp://ftp.ncbi.nih.gov/snp"+36                     │ │
│ │        >                                                                                                                         │ │
│ │ work = functools.partial(<function DirectoryTree._load_directory at 0x1246a1cf0>, BrowsrDirectoryTree(id='tree-view'),           │ │
│ │        TreeNode('JSON', DirEntry(path=UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON'), loaded=True)))                      │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                                      │
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/site-packages/textual/widgets/_directory_tree.py:366 in               │
│ _load_directory                                                                                                                      │
│                                                                                                                                      │
│   363 │   │   │   The list of entries within the directory associated with the node.                                                 │
│   364 │   │   """                                                                                                                    │
│   365 │   │   assert node.data is not None                                                                                           │
│ ❱ 366 │   │   return sorted(                                                                                                         │
│   367 │   │   │   self.filter_paths(                                                                                                 │
│   368 │   │   │   │   self._directory_content(node.data.path, get_current_worker())                                                  │
│   369 │   │   │   ),                                                                                                                 │
│                                                                                                                                      │
│ ╭────────────────────────────────────────────────── locals ──────────────────────────────────────────────────╮                       │
│ │ node = TreeNode('JSON', DirEntry(path=UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON'), loaded=True)) │                       │
│ │ self = BrowsrDirectoryTree(id='tree-view')                                                                 │                       │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                       │
│                                                                                                                                      │
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/site-packages/textual/widgets/_directory_tree.py:370 in <lambda>      │
│                                                                                                                                      │
│   367 │   │   │   self.filter_paths(                                                                                                 │
│   368 │   │   │   │   self._directory_content(node.data.path, get_current_worker())                                                  │
│   369 │   │   │   ),                                                                                                                 │
│ ❱ 370 │   │   │   key=lambda path: (not self._safe_is_dir(path), path.name.lower()),                                                 │
│   371 │   │   )                                                                                                                      │
│   372 │                                                                                                                              │
│   373 │   @work(exclusive=True)                                                                                                      │
│                                                                                                                                      │
│ ╭─────────────────────────────────────── locals ────────────────────────────────────────╮                                            │
│ │ path = UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr2.json.bz2.md5') │                                            │
│ │ self = BrowsrDirectoryTree(id='tree-view')                                            │                                            │
│ ╰───────────────────────────────────────────────────────────────────────────────────────╯                                            │
│                                                                                                                                      │
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/site-packages/textual/widgets/_directory_tree.py:311 in _safe_is_dir  │
│                                                                                                                                      │
│   308 │   │   │   `True` if the path is for a directory, `False` if not.                                                             │
│   309 │   │   """                                                                                                                    │
│   310 │   │   try:                                                                                                                   │
│ ❱ 311 │   │   │   return path.is_dir()                                                                                               │
│   312 │   │   except PermissionError:                                                                                                │
│   313 │   │   │   # We may or may not have been looking at a directory, but we                                                       │
│   314 │   │   │   # don't have the rights or permissions to even know that. Best                                                     │
│                                                                                                                                      │
│ ╭─────────────────────────────────────── locals ────────────────────────────────────────╮                                            │
│ │ path = UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr2.json.bz2.md5') │                                            │
│ ╰───────────────────────────────────────────────────────────────────────────────────────╯                                            │
│                                                                                                                                      │
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/site-packages/upath/core.py:447 in is_dir                             │
│                                                                                                                                      │
│   444 │                                                                                                                              │
│   445 │   def is_dir(self) -> bool:                                                                                                  │
│   446 │   │   try:                                                                                                                   │
│ ❱ 447 │   │   │   info = self._accessor.info(self)                                                                                   │
│   448 │   │   │   if info["type"] == "directory":                                                                                    │
│   449 │   │   │   │   return True                                                                                                    │
│   450 │   │   except FileNotFoundError:                                                                                              │
│                                                                                                                                      │
│ ╭─────────────────────────────────────── locals ────────────────────────────────────────╮                                            │
│ │ self = UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr2.json.bz2.md5') │                                            │
│ ╰───────────────────────────────────────────────────────────────────────────────────────╯                                            │
│                                                                                                                                      │
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/site-packages/upath/core.py:251 in __getattr__                        │
│                                                                                                                                      │
│   248 │   │   if item == "_accessor":                                                                                                │
│   249 │   │   │   # cache the _accessor attribute on first access                                                                    │
│   250 │   │   │   kwargs = self._kwargs.copy()                                                                                       │
│ ❱ 251 │   │   │   self._accessor = _accessor = self._default_accessor(self._url, **kwargs)                                           │
│   252 │   │   │   return _accessor                                                                                                   │
│   253 │   │   else:                                                                                                                  │
│   254 │   │   │   raise AttributeError(item)                                                                                         │
│                                                                                                                                      │
│ ╭──────────────────────────────────────── locals ─────────────────────────────────────────╮                                          │
│ │   item = '_accessor'                                                                    │                                          │
│ │ kwargs = {}                                                                             │                                          │
│ │   self = UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr2.json.bz2.md5') │                                          │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────╯                                          │
│                                                                                                                                      │
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/site-packages/upath/core.py:44 in __init__                            │
│                                                                                                                                      │
│    41 │   │   │   cls = get_filesystem_class(None)                                                                                   │
│    42 │   │   │   url_kwargs = {}                                                                                                    │
│    43 │   │   url_kwargs.update(kwargs)                                                                                              │
│ ❱  44 │   │   self._fs = cls(**url_kwargs)                                                                                           │
│    45 │                                                                                                                              │
│    46 │   def _format_path(self, path: UPath) -> str:                                                                                │
│    47 │   │   return path._path                                                                                                      │
│                                                                                                                                      │
│ ╭───────────────────────────────── locals ─────────────────────────────────╮                                                         │
│ │        cls = <class 'fsspec.implementations.ftp.FTPFileSystem'>          │                                                         │
│ │     kwargs = {}                                                          │                                                         │
│ │ parsed_url = SplitResult(                                                │                                                         │
│ │              │   scheme='ftp',                                           │                                                         │
│ │              │   netloc='ftp.ncbi.nih.gov',                              │                                                         │
│ │              │   path='/snp/archive/b156/JSON/refsnp-chr2.json.bz2.md5', │                                                         │
│ │              │   query='',                                               │                                                         │
│ │              │   fragment=''                                             │                                                         │
│ │              )                                                           │                                                         │
│ │       self = <upath.core._FSSpecAccessor object at 0x127823ca0>          │                                                         │
│ │ url_kwargs = {'host': 'ftp.ncbi.nih.gov'}                                │                                                         │
│ ╰──────────────────────────────────────────────────────────────────────────╯                                                         │
│                                                                                                                                      │
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/site-packages/fsspec/spec.py:79 in __call__                           │
│                                                                                                                                      │
│     76 │   │   │   cls._latest = token                                                                                               │
│     77 │   │   │   return cls._cache[token]                                                                                          │
│     78 │   │   else:                                                                                                                 │
│ ❱   79 │   │   │   obj = super().__call__(*args, **kwargs)                                                                           │
│     80 │   │   │   # Setting _fs_token here causes some static linters to complain.                                                  │
│     81 │   │   │   obj._fs_token_ = token                                                                                            │
│     82 │   │   │   obj.storage_args = args                                                                                           │
│                                                                                                                                      │
│ ╭───────────────────────────── locals ──────────────────────────────╮                                                                │
│ │         args = ()                                                 │                                                                │
│ │          cls = <class 'fsspec.implementations.ftp.FTPFileSystem'> │                                                                │
│ │ extra_tokens = ()                                                 │                                                                │
│ │       kwargs = {'host': 'ftp.ncbi.nih.gov'}                       │                                                                │
│ │         skip = False                                              │                                                                │
│ │        token = 'e3e21960d2814ffeada0de2279e7ad4f'                 │                                                                │
│ ╰───────────────────────────────────────────────────────────────────╯                                                                │
│                                                                                                                                      │
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/site-packages/fsspec/implementations/ftp.py:71 in __init__            │
│                                                                                                                                      │
│    68 │   │   │   self.blocksize = block_size                                                                                        │
│    69 │   │   else:                                                                                                                  │
│    70 │   │   │   self.blocksize = 2**16                                                                                             │
│ ❱  71 │   │   self._connect()                                                                                                        │
│    72 │                                                                                                                              │
│    73 │   def _connect(self):                                                                                                        │
│    74 │   │   if sys.version_info >= (3, 9):                                                                                         │
│                                                                                                                                      │
│ ╭─────────────────────────────────── locals ────────────────────────────────────╮                                                    │
│ │       acct = None                                                             │                                                    │
│ │ block_size = None                                                             │                                                    │
│ │   encoding = 'utf-8'                                                          │                                                    │
│ │       host = 'ftp.ncbi.nih.gov'                                               │                                                    │
│ │     kwargs = {}                                                               │                                                    │
│ │   password = None                                                             │                                                    │
│ │       port = 21                                                               │                                                    │
│ │       self = <fsspec.implementations.ftp.FTPFileSystem object at 0x127af8220> │                                                    │
│ │    tempdir = None                                                             │                                                    │
│ │    timeout = 30                                                               │                                                    │
│ │   username = None                                                             │                                                    │
│ ╰───────────────────────────────────────────────────────────────────────────────╯                                                    │
│                                                                                                                                      │
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/site-packages/fsspec/implementations/ftp.py:82 in _connect            │
│                                                                                                                                      │
│    79 │   │   else:                                                                                                                  │
│    80 │   │   │   self.ftp = FTP(timeout=self.timeout)                                                                               │
│    81 │   │   self.ftp.connect(self.host, self.port)                                                                                 │
│ ❱  82 │   │   self.ftp.login(*self.cred)                                                                                             │
│    83 │                                                                                                                              │
│    84 │   @classmethod                                                                                                               │
│    85 │   def _strip_protocol(cls, path):                                                                                            │
│                                                                                                                                      │
│ ╭──────────────────────────────── locals ─────────────────────────────────╮                                                          │
│ │ self = <fsspec.implementations.ftp.FTPFileSystem object at 0x127af8220> │                                                          │
│ ╰─────────────────────────────────────────────────────────────────────────╯                                                          │
│                                                                                                                                      │
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/ftplib.py:414 in login                                                │
│                                                                                                                                      │
│   411 │   │   │   passwd = passwd + 'anonymous@'                                                                                     │
│   412 │   │   resp = self.sendcmd('USER ' + user)                                                                                    │
│   413 │   │   if resp[0] == '3':                                                                                                     │
│ ❱ 414 │   │   │   resp = self.sendcmd('PASS ' + passwd)                                                                              │
│   415 │   │   if resp[0] == '3':                                                                                                     │
│   416 │   │   │   resp = self.sendcmd('ACCT ' + acct)                                                                                │
│   417 │   │   if resp[0] != '2':                                                                                                     │
│                                                                                                                                      │
│ ╭─────────────────────────────────────── locals ───────────────────────────────────────╮                                             │
│ │   acct = ''                                                                          │                                             │
│ │ passwd = 'anonymous@'                                                                │                                             │
│ │   resp = '331 Anonymous login ok, send your complete email address as your password' │                                             │
│ │   self = <ftplib.FTP object at 0x127af8430>                                          │                                             │
│ │   user = 'anonymous'                                                                 │                                             │
│ ╰──────────────────────────────────────────────────────────────────────────────────────╯                                             │
│                                                                                                                                      │
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/ftplib.py:281 in sendcmd                                              │
│                                                                                                                                      │
│   278 │   def sendcmd(self, cmd):                                                                                                    │
│   279 │   │   '''Send a command and return the response.'''                                                                          │
│   280 │   │   self.putcmd(cmd)                                                                                                       │
│ ❱ 281 │   │   return self.getresp()                                                                                                  │
│   282 │                                                                                                                              │
│   283 │   def voidcmd(self, cmd):                                                                                                    │
│   284 │   │   """Send a command and expect a response beginning with '2'."""                                                         │
│                                                                                                                                      │
│ ╭───────────────── locals ──────────────────╮                                                                                        │
│ │  cmd = 'PASS anonymous@'                  │                                                                                        │
│ │ self = <ftplib.FTP object at 0x127af8430> │                                                                                        │
│ ╰───────────────────────────────────────────╯                                                                                        │
│                                                                                                                                      │
│ /Users/andreaspoehlmann/Environments/mambaforge/lib/python3.10/ftplib.py:254 in getresp                                              │
│                                                                                                                                      │
│   251 │   │   if c == '4':                                                                                                           │
│   252 │   │   │   raise error_temp(resp)                                                                                             │
│   253 │   │   if c == '5':                                                                                                           │
│ ❱ 254 │   │   │   raise error_perm(resp)                                                                                             │
│   255 │   │   raise error_proto(resp)                                                                                                │
│   256 │                                                                                                                              │
│   257 │   def voidresp(self):                                                                                                        │
│                                                                                                                                      │
│ ╭───────────────────────────── locals ─────────────────────────────╮                                                                 │
│ │    c = '5'                                                       │                                                                 │
│ │ resp = '530 Sorry, you have exceeded the number of connections.' │                                                                 │
│ │ self = <ftplib.FTP object at 0x127af8430>                        │                                                                 │
│ ╰──────────────────────────────────────────────────────────────────╯                                                                 │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
error_perm: 530 Sorry, you have exceeded the number of connections.

When just doing .iterdir() this doesn't occur with universal_pathlib:

>>> list(upath.UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON').iterdir()) 
[UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr10.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr10.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/CHECKSUMS'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr11.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr11.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr12.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr12.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr13.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr13.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr14.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr14.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr15.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr15.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr16.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr16.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr17.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr17.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr18.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr18.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr19.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr19.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr1.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr1.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr20.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr20.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr21.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr21.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr22.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr22.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr2.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr2.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr3.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr3.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr4.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr4.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr5.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr5.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr6.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr6.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr7.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr7.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr8.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr8.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr9.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chr9.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chrMT.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chrMT.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chrX.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chrX.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chrY.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-chrY.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-merged.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-merged.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-nosnppos.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-nosnppos.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-other.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-other.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-sample.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-sample.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-unsupported.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-unsupported.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-withdrawn.json.bz2.md5'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/refsnp-withdrawn.json.bz2'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/JSON_README.txt'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/rsjson_demo.py'),
 UPath('ftp://ftp.ncbi.nih.gov/snp/archive/b156/JSON/frequency_studies.json')]

Cheers, Andreas 😃

juftin commented 10 months ago

Oh, this is an interesting one, I was able to replicate it as well. Textual, the TUI framework browsr is built on launches an async worker process to traverse through a directory and get its contents. There must be multiple connections due to a worker process that ultimately throws this error.

This might be a tricky one to solve - I'll have to think on it.