'~' characters are extremely rare in paths, but I concede that extremely rare is not the same as impossible. I'll change the serialization to json.
I will add the try/except around makedirs in case of a directory creation race.
I believe the mode detection is needed; I saw errors in testing without it.
It's probably a good idea to use the existing lock directory to serialize accesses to get_set_driver_format. I believe it's safe to read the file without the lock, but we should use the lock when we write the file.
I will make these changes (and some other improvements to the tests) and submit an updated patch.
Thanks for the review Stanislaw.
'~' characters are extremely rare in paths, but I concede that extremely rare is not the same as impossible. I'll change the serialization to json.
I will add the try/except around makedirs in case of a directory creation race.
I believe the mode detection is needed; I saw errors in testing without it.
It's probably a good idea to use the existing lock directory to serialize accesses to get_set_ driver_ format. I believe it's safe to read the file without the lock, but we should use the lock when we write the file.
I will make these changes (and some other improvements to the tests) and submit an updated patch.