The path locale is lazy initialized and to avoid deinitialization errors in multithreading environments, it is set explicitly by the main thread.