Issue #2 new

Crash if task-dir does not exists

Douglas Santos
created an issue

If you pass a non existent directory for --task-dir option, script crashes with the following traceback:

Traceback (most recent call last):
  File "/home/douglas/src/config/t/t.py", line 312, in <module>
    _main()
  File "/home/douglas/src/config/t/t.py", line 300, in _main
    td.write(options.delete)
  File "/home/douglas/src/config/t/t.py", line 233, in write
    with open(path, 'w') as tfile:
IOError: [Errno 2] No such file or directory: '/home/douglas/lists/car'

As a solution, the script could issue a warning or create the missing directory.

Comments (3)

  1. Sébastien Santoro

    This occurs only when you try to write. For read operation, it's smooth:

    /home/dereckson/dev/t ] ./t.py -t /nonexistent
    /home/dereckson/dev/t ] ./t.py -t /nonexistent Lorem ipsum dolor sit amet nunc abunctur
    Traceback (most recent call last):
      File "./t.py", line 312, in <module>
        _main()
      File "./t.py", line 300, in _main
        td.write(options.delete)
      File "./t.py", line 233, in write
        with open(path, 'w') as tfile:
    IOError: [Errno 2] No such file or directory: '/nonexistent/tasks'
    
  2. Log in to comment