abaldwin88 / roamer

The Plain Text File Manager
MIT License
607 stars 15 forks source link

Crash on symlink to deleted file. #29

Closed giodamelio closed 6 years ago

giodamelio commented 6 years ago

roamer --version: 0.2.3 or current master (39d8b25) OS: Linux Python version: 3.6.2 Steps to reproduce: Try using roamer on a directory that has a symlink to a file that no longer exists.

When I use roamer on a directory that has a symlink to file that has been deleted, it shows the directory list in my editor but instead of a digest it shows the string 'None', when I exit the editor it crashes.

I'm pretty sure that is comes down to the fact that os.path.exists returns False for broken symlinks. See here.

Traceback (most recent call last):
  File "/usr/bin/roamer", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/giodamelio/Projects/forks/roamer/bin/roamer", line 4, in <module>
    main.start(sys.argv)
  File "/home/giodamelio/Projects/forks/roamer/roamer/main.py", line 18, in start
    Session(skipapproval=skipapproval).run()
  File "/home/giodamelio/Projects/forks/roamer/roamer/session.py", line 35, in run
    self.process(output)
  File "/home/giodamelio/Projects/forks/roamer/roamer/session.py", line 40, in process
    engine.compile_commands()
  File "/home/giodamelio/Projects/forks/roamer/roamer/engine.py", line 19, in compile_commands
    self.handle_unknown_digests()
  File "/home/giodamelio/Projects/forks/roamer/roamer/engine.py", line 51, in handle_unknown_digests
    raise Exception('digest %s not found' % digest)
Exception: digest None not found