Skip to content

Conversation

davidparsson
Copy link

@davidparsson davidparsson commented Oct 16, 2017

If a user edits a new, non-existent file and decides to not save it, edit() will return None instead of raising an exception.

On master, when not saving the file in the editor:

$ python -c 'import editor; print(editor.edit("/tmp/does-not-exist"))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "editor.py", line 100, in edit
    with open(filename, mode='rb') as f:
IOError: [Errno 2] No such file or directory: '/tmp/does-not-exist'

On this branch:

$ python -c 'import editor; print(editor.edit("/tmp/does-not-exist"))'
None

@davidparsson davidparsson force-pushed the fix/no-exception-when-file-missing branch from e330071 to ffdfc92 Compare October 16, 2017 08:06
If a user edits a new, non-existent file and decides to not save it,
edit() will return None instead of raising an exception.
@davidparsson davidparsson force-pushed the fix/no-exception-when-file-missing branch from ffdfc92 to 31c3675 Compare October 16, 2017 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant