- Newest
- Most votes
- Most comments
Hello.
Starting with Python 3.12, the Lambda OS is now Amazon Linux 2023.
I think this is probably related.
https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html#runtimes-supported
There is also a report on stackoverflow, but it seems that it is necessary to install "glibc-all-langpacks" for Amazon Linux 2023 containers.
https://stackoverflow.com/questions/76581344/cannot-set-installed-locale-with-aws-linux-2023
You can check the packages installed on Amazon Linux 2023 in the following document.
https://docs.aws.amazon.com/AL2/latest/relnotes/relnotes-20230424.html
If you really want to change the locale settings, you may need to use a custom runtime.
https://docs.aws.amazon.com/lambda/latest/dg/runtimes-custom.html
https://docs.aws.amazon.com/lambda/latest/dg/images-create.html
You could put it into your lambda layers
it appears that you don't even need layers. you can copy the files from the
/usr/lib/localedirectory of an AL2023 instance, add to the zip package, and set the environment variable LOCPATH to it. you can set from the lambda environment, or just from code usingos.environ["LOCPATH"] = ...before callingsetlocale. it even seems to be architecture independent, e.g. i used x86 to install locales, then used it from an arm lambda.

disappointing. i don't think a custom runtime solves this, if it involves dnf. it seems that i'll need to containerize. it is really weird to me that aws would go with such a regression.