Unable to set locale in my python code

Saurabh 26 Reputation points
2021-07-08T07:26:23.4+00:00

The following code fails in my Python script:
locale.setlocale(locale.LC_NUMERIC, 'en_IN')

Locale -a command in powershell gives me the following:

C
C.UTF-8
en_US
en_US.utf8
POSIX

Requesting for help as I'm not sure how to add en_IN to the locale on my azure app and then use it in my Python code.
Thanks for your help.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,794 questions
{count} votes

Accepted answer
  1. Pierre-Luc Giguere 1,076 Reputation points
    2021-07-13T11:53:25.373+00:00

    Hi,

    That changes things.

    You have to customize the startup script and install locales and local-all following these steps: https://azureossd.github.io/2020/01/23/custom-startup-for-nodejs-python/

    Source: https://github.com/MicrosoftDocs/azure-docs/issues/51974

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Saurabh 26 Reputation points
    2021-07-15T12:16:12.41+00:00

    Thanks for your support Pierre and Mayank.

    Because of the change in the build process on Azure, the deployment no longer happens in a fixed folder.

    I used the $APP_PATH variable in the startup script and it seems to be working now.

    Thank you for your help.

    1 person found this answer helpful.
    0 comments No comments

  2. Pierre-Luc Giguere 1,076 Reputation points
    2021-07-08T17:49:26.52+00:00

    Hi,

    en-IN seems to be the correct spelling.

    Please refer to the following documentation:

    https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c?redirectedfrom=MSDN