Remove unnecessary setting of locale::global #1636
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We used to need to set the global locale before calling something that used OIIO parsing functions. This is no longer the case ( as of OIIO-1.9, and we now require 2.3 ), so we can now remove these calls.
It came up for me because this code seems to interact strangely with locale in Python - I think this is because something synchs the C++ locale across to Python, but if locale::global hasn't been called in C++ yet, and the locale has only been set in Python, oldlocale doesn't get set to the Python locale ... I could try to figure out more of what's going on, but the simple answer is just to remove this code that is no longer needed. LG though it was reasonable when I asked on the dev list: https://lists.aswf.io/g/osl-dev/message/5081
A potential follow-up would be to move the lock_guard inside parse, since there's a comment indicating that the locale was the reason this hadn't been done.
Checklist: