-
Notifications
You must be signed in to change notification settings - Fork 71
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
Set locale before (de)serializing data for SQLite #1837
base: main
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 12243810876Details
💛 - Coveralls |
Downstream Build Status Report - b4d8e8b - 2024-12-09 20:33:08 +0000Build
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we decided to explore the idea of selecting a locale and storing it in the DB so that it could be read for post-processing? Or did we decide to leave this for a future feature?
I thought we decided to store it in the DB. That being said however, I'm struggling with the implementation because the place that we need to read the locale from the DB is in the code interfacing with the DB. I'm thinking we read the locale from the environment, falling back to the C locale if not specified. This leaves us with the potential incompatibility of users writing archetypes named using non-ASCII characters. I can try to add tests for this and appropriate error handling so it gracefully fails in this case. |
Closes cyclus/cymetric#205.
I think there must be some inconsistency with how
libc++
andlibboost
handle default locales. This PR callsss.imbue()
to set the locale according to the user's environment, which seems to solve the segfault describe in cyclus/cymetric#205 (at least when I build and test on my arm Mac machine). We could hardcode this to the "C" locale if we want to make it more robust. The instance where I could see issues arising is if a user runs a sim in one environment then reads the SQLite DB in a different environment with a different locale.