Skip to content

fix locale warning #141

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

Merged
merged 1 commit into from
Aug 16, 2024
Merged

Conversation

dura0ok
Copy link
Collaborator

@dura0ok dura0ok commented Aug 14, 2024

DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
Исправил заменив на getlocale

@dura0ok dura0ok force-pushed the fix-locale-warning branch from 9fe94ff to c892e6c Compare August 14, 2024 13:26
@demonolock
Copy link
Contributor

@dura0ok посмотрите, пожалуйста, упал тест

AttributeError: module 'locale' has no attribute 'getencoding'
https://app.travis-ci.com/github/postgrespro/testgres/jobs/625126635

Можно попробовать так обойти

if not hasattr(locale, 'getencoding'):
    locale.getencoding = locale.getpreferredencoding
DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
rewrite using getlocale
@dura0ok dura0ok force-pushed the fix-locale-warning branch from c892e6c to 7903ad1 Compare August 15, 2024 04:55
@dura0ok
Copy link
Collaborator Author

dura0ok commented Aug 15, 2024

@dura0ok посмотрите, пожалуйста, упал тест

AttributeError: module 'locale' has no attribute 'getencoding' https://app.travis-ci.com/github/postgrespro/testgres/jobs/625126635

Можно попробовать так обойти

if not hasattr(locale, 'getencoding'):
    locale.getencoding = locale.getpreferredencoding

@demonolock Ага, спасибо, теперь все тесты прошли

@demonolock demonolock merged commit 1d1d3f0 into postgrespro:master Aug 16, 2024
1 check passed
@dura0ok dura0ok deleted the fix-locale-warning branch August 27, 2024 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants