apple / swift-corelibs-foundation

The Foundation Project, providing core utilities, internationalization, and OS independence
swift.org
Apache License 2.0
5.23k stars 1.12k forks source link

UserDefaults doesn't work on Windows when USERNAME and USERPROFILE don't match #4997

Open stevenbrix opened 6 days ago

stevenbrix commented 6 days ago

Since UserDefaults hand builds the path to the local app data location, this location is incorrect if the USERNAME doesn't match the USERPROFILE location directory. This means that all UserDefaults writes will fail because the location on disk won't exist.