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

issue special characters in product_types.yml #1317

Closed
msimeon-cnes opened this issue Sep 10, 2024 · 1 comment
Closed

issue special characters in product_types.yml #1317

msimeon-cnes opened this issue Sep 10, 2024 · 1 comment

Comments

@msimeon-cnes
Copy link

We have a linux user that is having issues with some characters in products_type.yml. After installing eodag 2.12 in a conda environment, when running for the first time
dag = eodag.EODataAccessGateway()
the following error appears

ReaderError: unacceptable character #x0080: special characters are not allowed
  in "/home/anaconda3/envs/swot-ypra/lib/python3.10/site-packages/eodag/resources/product_types.yml", position 40894

It seems that some characters (line 929) may not be UTF-8 compatible.
The issue was resolved be cleaning the file

import re

with open(input_path, 'r', encoding='utf-8') as file:
    content = file.read()

# Remove characters with ASCII values outside the printable range
cleaned_content = re.sub(r'[^\x00-\x7F]+', '', content)

with open(output_path, 'w', encoding='utf-8') as file:
    file.write(cleaned_content)

Could you consider checking and correcting the products_type file in the repository ?

@sbrunato
Copy link
Collaborator

Hello @msimeon-cnes and thanks for submitting this issue. These special characters were removed in #1131 that is included in v3.0.0b1 (stable v3.0.0 is also incoming)

This issue was closed.
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

No branches or pull requests

2 participants