pls-rs / pls

`pls` is a prettier and powerful `ls(1)` for the pros.
https://pls.cli.rs/
GNU General Public License v3.0
830 stars 24 forks source link

1.6.0. Crashes with broken symlink #1

Closed rautesamtr closed 2 years ago

rautesamtr commented 2 years ago

Steam uses a broken symlink in the home folder for backwards compatibility:

.steampath -> /home/username/.steam/sdk32/steam

pls crashes while trying to read this

multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "/usr/lib/python3.10/site-packages/pls/fs/list.py", line 43, in parse_nodes
    return Node(node_name, path=node_path)
  File "/usr/lib/python3.10/site-packages/pls/models/node.py", line 26, in __init__
    self.stat = path.stat()
  File "/usr/lib/python3.10/pathlib.py", line 1095, in stat
    return self._accessor.stat(self, follow_symlinks=follow_symlinks)
FileNotFoundError: [Errno 2] No such file or directory: '/home/username/.steampath'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/bin/pls", line 33, in <module>
    sys.exit(load_entry_point('pls==1.6.0', 'console_scripts', 'pls')())
  File "/usr/lib/python3.10/site-packages/pls/main.py", line 16, in main
    nodes = read_input()
  File "/usr/lib/python3.10/site-packages/pls/fs/list.py", line 55, in read_input
    comp_nodes = pool.map(parse_nodes, all_nodes)
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 364, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/usr/lib/python3.10/multiprocessing/pool.py", line 771, in get
    raise self._value
FileNotFoundError: [Errno 2] No such file or directory: '/home/username/.steampath'
m-ocean-it commented 2 years ago

My exact issue, too!

dhruvkb commented 2 years ago

This was fixed in commit f218b36 on main, just have to draft a new release.

dhruvkb commented 2 years ago

Released version 1.6.1 that fixes this issue, please upgrade!

m-ocean-it commented 2 years ago

Released version 1.6.1 that fixes this issue, please upgrade!

Yep, fixed! Thanks!