Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecate locale.format() function #94226

Closed
vstinner opened this issue Jun 24, 2022 · 2 comments
Closed

Remove deprecate locale.format() function #94226

vstinner opened this issue Jun 24, 2022 · 2 comments
Assignees
Labels
3.12 bugs and security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@vstinner
Copy link
Member

The locale.format() function is deprecated since Python 3.7: see issue #54588 for the rationale. IMO it's now time to remove this deprecated function: locale.format_string() can be used since Python 3.7.

@vstinner vstinner added the type-bug An unexpected behavior, bug, or error label Jun 24, 2022
@vstinner
Copy link
Member Author

I proposed PR #94229.

@CAM-Gerlach CAM-Gerlach added stdlib Python modules in the Lib dir 3.12 bugs and security fixes labels Jun 25, 2022
vstinner added a commit that referenced this issue Jun 26, 2022
Remove the locale.format() function, deprecated in Python
3.7: use locale.format_string() instead.

Remove TestFormatPatternArg test case: it is irrelevant for
locale.format_string() which accepts complex formats.
@vstinner
Copy link
Member Author

Fixed by #94229

dwrobel added a commit to dwrobel/linuxcnc that referenced this issue Dec 11, 2023
Fixes the following error on python 3.12:
 Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/qtvcp/widgets/origin_offsetview.py",
   line 383, in periodic_check
    self.reload_offsets()
  File "/usr/lib/python3.12/site-packages/qtvcp/widgets/origin_offsetview.py",
   line 270, in reload_offsets
    degree_tmpl = "%{}.2f".format(len(locale.format(tmpl, 0)))
                                      ^^^^^^^^^^^^^
 AttributeError: module 'locale' has no attribute 'format'. Did you mean: '_format'?

See also: python/cpython#94226

Signed-off-by: Damian Wrobel <dwrobel.contractor@libertyglobal.com>
dwrobel added a commit to dwrobel/linuxcnc that referenced this issue Dec 11, 2023
Fixes the following error on python 3.12:
 Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/qtvcp/widgets/origin_offsetview.py",
   line 383, in periodic_check
    self.reload_offsets()
  File "/usr/lib/python3.12/site-packages/qtvcp/widgets/origin_offsetview.py",
   line 270, in reload_offsets
    degree_tmpl = "%{}.2f".format(len(locale.format(tmpl, 0)))
                                      ^^^^^^^^^^^^^
 AttributeError: module 'locale' has no attribute 'format'. Did you mean: '_format'?

See also: python/cpython#94226

Signed-off-by: Damian Wrobel <dwrobel.contractor@libertyglobal.com>
vikrrrr pushed a commit to vikrrrr/linuxcnc that referenced this issue Sep 7, 2024
Fixes the following error on python 3.12:
 Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/qtvcp/widgets/origin_offsetview.py",
   line 383, in periodic_check
    self.reload_offsets()
  File "/usr/lib/python3.12/site-packages/qtvcp/widgets/origin_offsetview.py",
   line 270, in reload_offsets
    degree_tmpl = "%{}.2f".format(len(locale.format(tmpl, 0)))
                                      ^^^^^^^^^^^^^
 AttributeError: module 'locale' has no attribute 'format'. Did you mean: '_format'?

See also: python/cpython#94226

Signed-off-by: Damian Wrobel <dwrobel.contractor@libertyglobal.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants