-
Notifications
You must be signed in to change notification settings - Fork 24
Change locale.getdefaultlocale to getlocale #73
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
base: master
Are you sure you want to change the base?
Conversation
This is great to reduce several deprecation warnings on CI. Is there any plan to release this? |
Please get this merged, it has been here for several months and causes a huge spam in our CI 😢 EDIT: @tonybaloney , any plans to merge this and #72 and create a new release anytime soon? :) |
I was also looking into the abondance of depreciation errors and also made a pull but didn't submit it yet, since this one is here allready. I solved (patched, in my case for Python 3.11.8 & 3.12.2) in pytest_nunit/nunit.py but just modifying according to the set best practise. def _getlocale():
locale.setlocale(locale.LC_ALL, '')
current_locale=locale.getlocale()
language_code=sys.getdefaultencoding()
if language_code:
return language_code
return "en-US" |
This makes sense, I just wish there wasn't all the extra complexity splitting and manipulating strings along with a try..except..pass My locale is simpler, so I wonder how many other edge cases we have to consider
|
Further reports suggests this new locale feature can return more edge cases python/cpython#82986 I'm more tempted to mute warnings for this single call since its deprecation is scheduled for Python 3.15 and by that time hopefully the behaviour will be fixed. |
Sounds reasonable 😊👍 |
Locale en edge cases are going hand in hand, so mute and sort out go the best approach makes sense. |
Would you mind recommending a way to mute warnings in the context of Azure Pipelines? pytest-nunit is a dependency of |
@carlos-villavicencio-adsk if you update your lock files to use the pytest-nunit released yesterday (https://github.com/pytest-dev/pytest-nunit/releases/tag/1.0.6) you should no longer have any warnings 😊 pytest-azurepipelines should automatically use the new release. |
That's awesome @Wesztman. Thank you for the good news. |
Can confirm! Aweome! |
Fix Deprecation warning in Python 3.11:
pytest_nunit\nunit.py:119: DeprecationWarning: Use setlocale(), getencoding() and getlocale() instead
Differences: