Cannot write to new file when using generator_utils.open
With Python's built-in open function, I can write to a new file like this:
with open('bla.txt', 'w') as f:
f.write('hallo')
However, when I use open from generator_utils, it raises a FileNotFoundError. I expect generator_utils.open to work mostly the same as builtins.open, so I do not expect an error to be raised.
One possible fix would be to implement custom behaviour when the mode is 'w'.
Another possible fix would be to be explicit about not supporting writing to files. (One might argue that it is better to use mocking in such a case anyway.)
Edited by Frank Mulder