Skip to content
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

Some operations can fail if the date/time is not the expected one #96

Merged
merged 1 commit into from
May 30, 2024

Conversation

stronk7
Copy link
Member

@stronk7 stronk7 commented May 30, 2024

Basically, when using english, it works ok (en_US, en_AU.UTF-8, ...) but can fail with some collations like es_ES.UTf-8 when making some calculations because the expected formats are different from what the collation provides.

So, we are going to use LC_ALL=C in all the "date" commands used by the scripts in order to provide a consistent behaviour no matter which collation is being used by default.

We could also have set LC_TIME, LANG... but as far as LC_ALL is the one with max precedence, we just set that one, and only for the execution of the "date" commands. And "C", because that is the default, basic collation that all the systems support much like the POSIX one, only ASCII and enough for our interests).

Basically, when using english, it works ok (en_US, en_AU.UTF-8, ...)
but can fail with some collations like es_ES.UTf-8 when making
some calculations because the expected formats are different from
what the collation provides.

So, we are going to use LC_ALL=C in all the "date" commands
used by the scripts in order to provide a consistent behaviour
no matter which collation is being used by default.

We could also have set LC_TIME, LANG... but as far as LC_ALL is
the one with max precedence, we just set that one, and only
for the execution of the "date" commands. And "C", because that
is the default, basic collation that all the systems support
much like the POSIX one, only ASCII and enough for our interests).
@stronk7 stronk7 marked this pull request as draft May 30, 2024 15:47
@stronk7 stronk7 marked this pull request as ready for review May 30, 2024 16:07
Copy link
Member

@sarjona sarjona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Eloy!
Thanks for the quick response! The patch looks great and works as expected (I've been able to confirm locally that with your patch, I can run the pre-release.sh now). Yupiiiiiiiii!!

@sarjona sarjona merged commit f6c9a6b into moodlehq:main May 30, 2024
1 check passed
@stronk7 stronk7 deleted the collations_grrr branch May 30, 2024 16:10
@stronk7
Copy link
Member Author

stronk7 commented May 30, 2024

Tata!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants