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

consistently set encoding=utf-8 for opening files #69

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

h-vetinari
Copy link
Contributor

Companion to conda-forge/conda-smithy#2244; necessary to rerender rattler recipes on windows.

@h-vetinari
Copy link
Contributor Author

I don't know what changed in windows-land (I had thought at first that it was triggered by a local change on my machine), but this is now actually breaking CI - after a passing run, the output validation runs into:

Traceback (most recent call last):
  File "D:\Miniforge\Scripts\validate_recipe_outputs-script.py", line 10, in <module>
    sys.exit(main())
             ^^^^^^
[...]
  File "D:\Miniforge\Lib\site-packages\rattler_build_conda_compat\render.py", line 72, in parse_recipe
    yaml_content = load_yaml(recipe_path.read_text())
                             ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Miniforge\Lib\pathlib.py", line 1028, in read_text
    return f.read()
           ^^^^^^^^
  File "D:\Miniforge\Lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 5038: character maps to <undefined>

Please help 😅 @nichmor @wolfv

@wolfv
Copy link
Member

wolfv commented Feb 18, 2025

Does this actually fix things? utf8 should be the default afaik since a while ...

@h-vetinari
Copy link
Contributor Author

h-vetinari commented Feb 18, 2025

Nope, it'll only be the default in python 3.15 (edit: see PEP686). I've also linked a PR with CI broken due to this.

@h-vetinari
Copy link
Contributor Author

Does this actually fix things?

Yes; I'm carrying the fixes from this PR in my local environment, otherwise I wouldn't be able to rerender the linked PR.

@wolfv wolfv merged commit 72e3b14 into prefix-dev:main Feb 18, 2025
6 checks passed
@wolfv
Copy link
Member

wolfv commented Feb 18, 2025

Do you need a release then?

@h-vetinari h-vetinari deleted the utf8 branch February 18, 2025 07:49
@h-vetinari
Copy link
Contributor Author

Do you need a release then?

That would be great yes! For my personal use I could work around it, but it's not great that this causes CI failures (--> IMO urgent).

@nichmor
Copy link
Collaborator

nichmor commented Feb 18, 2025

Do you need a release then?

That would be great yes! For my personal use I could work around it, but it's not great that this causes CI failures (--> IMO urgent).

hey! let me make a release

h-vetinari added a commit to h-vetinari/tinygrad-feedstock that referenced this pull request Feb 18, 2025
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.

3 participants