Fix in click.edit() for fast editors#1050
Conversation
|
Also, I understand that this is the right approach ()merge into 6.x-maintenance, and you take care of merging into |
|
Sorry, I realised there were a couple of tests not passing, I close this PR to fix them and I open it again ASAP. |
|
Tests should pass now (at least they pass in my fork) so for me the PR is ready to be merged. |
|
Hello, will this get a chance to be merged? Please let me know if I should change anything |
|
Retargeted this to master. This won't be in 7.0 but could be targeted at 7.1. Needs review before I can say for sure. |
|
Am I wrong in thinking that this test will fail on machines that do not have sed? Of course we're talking about the disfigured step child Windows. |
|
@russkel only the test will fail if sed is not available, but this I hope shouldn't be a problem (click itself will not need sed) |
46ffab1 to
c30c041
Compare
If a fast editor is used and the filesystem only provides a resolution of 1 second, edit() returns None if the file is edited and saved very quickly.
use context manager for opening file move encoding out of try block use isinstance instead of type
If a fast editor is used and the filesystem
only provides a resolution of 1s,
click.edit()returns None if the file is edited and saved very quickly.
This is a workaround that should work on all systems.
The added test would fail on my system before the fix.