Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

locale.getdefaultlocale is deprecated #1238

@graingert-coef

Description

@graingert-coef

getdefaultlocale is called here:

'ai.device.locale': locale.getdefaultlocale()[0],

and results in a deprecation warning:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/logging/config.py", line 573, in configure
    handler = self.configure_handler(handlers[name])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/logging/config.py", line 735, in configure_handler
    klass = self.resolve(cname)
            ^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/logging/config.py", line 402, in resolve
    self.importer(used)
  File "/home/vsts/work/1/s/venv/lib/python3.11/site-packages/opencensus/ext/azure/log_exporter/__init__.py", line 22, in <module>
    from opencensus.ext.azure.common import Options, utils
  File "/home/vsts/work/1/s/venv/lib/python3.11/site-packages/opencensus/ext/azure/common/utils.py", line 30, in <module>
    'ai.device.locale': locale.getdefaultlocale()[0],
                        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/locale.py", line 559, in getdefaultlocale
    warnings._deprecated(
  File "/opt/hostedtoolcache/Python/3.11.7/x64/lib/python3.11/warnings.py", line 514, in _deprecated
    warn(msg, DeprecationWarning, stacklevel=3)
DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions