Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1d1d3f0

Browse files
author
dura0ok
authored
fix locale warning (#141)
DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.rewrite using getlocale
1 parent8c193b2 commit1d1d3f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎testgres/operations/os_ops.py

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

2121

2222
defget_default_encoding():
23-
returnlocale.getdefaultlocale()[1]or'UTF-8'
23+
ifnothasattr(locale,'getencoding'):
24+
locale.getencoding=locale.getpreferredencoding
25+
returnlocale.getencoding()or'UTF-8'
2426

2527

2628
classOsOperations:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp