tartley / rerun

This project is DEPRECATED in favour of https://github.com/tartley/rerun2
Other
18 stars 4 forks source link

Exception if any broken symlinks exist #6

Closed tartley closed 10 years ago

tartley commented 10 years ago
$ rerun "echo 123"
Traceback (most recent call last):
  File "/usr/local/bin/rerun", line 9, in <module>
    load_entry_point('rerun==1.0.19', 'console_scripts', 'rerun')()
  File "/usr/local/lib/python2.6/dist-packages/rerun/rerun.py", line 104, in main
    get_parser('rerun', SKIP_DIRS, SKIP_EXT), sys.argv[1:]
  File "/usr/local/lib/python2.6/dist-packages/rerun/rerun.py", line 87, in mainloop
    get_changed_files(options.ignore)
  File "/usr/local/lib/python2.6/dist-packages/rerun/rerun.py", line 69, in get_changed_files
    if has_file_changed(fullname):
  File "/usr/local/lib/python2.6/dist-packages/rerun/rerun.py", line 49, in has_file_changed
    mtime = get_file_mtime(filename)
  File "/usr/local/lib/python2.6/dist-packages/rerun/rerun.py", line 34, in get_file_mtime
    return os.stat(filename)[stat.ST_MTIME]
OSError: [Errno 2] No such file or directory: './server-addons/base_external_mapping_csv'
tartley commented 10 years ago

Now uses os.lstat instead of os.stat, so does not attempt to follow symlinks at all.