Skip to content

Commit c892e6c

Browse files
author
Stepan Neretin
committed
fix locale warning
DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead. rewrite using getlocale
1 parent e1ed158 commit c892e6c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

testgres/operations/os_ops.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def __init__(self, host='127.0.0.1', port=None, ssh_key=None, username=None):
2020

2121

2222
def get_default_encoding():
23-
return locale.getdefaultlocale()[1] or 'UTF-8'
23+
locale.setlocale(locale.LC_ALL, '')
24+
return locale.getencoding() or 'UTF-8'
2425

2526

2627
class OsOperations:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy