hedy
hedy copied to clipboard
Fix test suite on windows
Two tests seem to be failing on windows. The test_yamlfile.py
failure is caused by atomic_write_file
, which is used by YamlFile
, not working on Windows.
@Mark-Giesen No rush of course but maybe you can pick this up too when you start? Do you also experience this issue?
Well, no rush indeed :-). This issue was solved by no longer using atomic writes. It simply renames the file. This is atomic and silent if destination exists on *ix systems, but results in an exception on Windows, which is swallowed. This could have been closed, but good it didn't. Renewed investigation found this "bug-fix": https://bugs.python.org/issue8828. It introduces replace() as alternative to rename() to get consistent behavior (and atomic if successful) between OS's. I think this might be a good idea and solve this issue for good now. See also: https://docs.python.org/3/library/os.html and https://stackoverflow.com/questions/69363867/difference-between-os-replace-and-os-rename (since stackoverflow is always right :-)) @rix0rrr or @Felienne, am I missing something?
Hi @Mark-Giesen, since it is "fixed" and there is so much going on, we won't be diving into this further atm. Of course if you want to submit a PR, feel free to do so but I am of the opinion that there is a lot of other things we all could be fixing.
Just cleaning up my @mentions :-).