UnicodeDecodeError occurs when a locale is not set because the library tries to open .env file in 'US-ASCII' encoding even for non-ASCII files.