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

Scons : Make encoding check more flexible #5409

Merged
merged 1 commit into from
Aug 9, 2023

Conversation

ericmehl
Copy link
Collaborator

After upgrading my system Python to 3.11.4 I found that it reports my encoding as utf-8 instead of UTF-8.

I don't know if this really qualifies as a bug fix, but I figured it will be better to get it early in the current chain than later. Happy to retarget to 1.3 if that's desirable.

Checklist

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have tested my change(s) in the test suite, and added new test cases where necessary.
  • My code follows the Gaffer project's prevailing coding style and conventions.

@ericmehl ericmehl changed the title Make encoding check more flexible Scons : Make encoding check more flexible Jul 26, 2023
SConstruct Outdated
@@ -48,7 +48,7 @@ import distutils.dir_util

EnsureSConsVersion( 3, 0, 2 ) # Substfile is a default builder as of 3.0.2

if locale.getpreferredencoding() != "UTF-8" :
if locale.getpreferredencoding().upper() != "UTF-8" :
Copy link
Member

Choose a reason for hiding this comment

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

I don't know if it matters or not, but I think codecs.lookup( locale.getpreferredencoding() ).name is the official way to get a canonical encoding name, so might be better than using upper()?

@ericmehl
Copy link
Collaborator Author

ericmehl commented Aug 8, 2023

Thanks for the tip! You beat me to approval before I could message about the update :)

@johnhaddon johnhaddon merged commit 986ce54 into GafferHQ:1.2_maintenance Aug 9, 2023
4 checks passed
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