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

HRA criteria table loading fails cryptically when CSV has a BOM #1460

Closed
phargogh opened this issue Dec 5, 2023 · 1 comment · Fixed by #1461
Closed

HRA criteria table loading fails cryptically when CSV has a BOM #1460

phargogh opened this issue Dec 5, 2023 · 1 comment · Fixed by #1461
Assignees
Labels
bug Something isn't working in progress This issue is actively being worked on

Comments

@phargogh
Copy link
Member

phargogh commented Dec 5, 2023

A user on the forums reported this exception:

2/04/2023 13:21:47 natcap.invest.utils ERROR Exception while executing natcap.invest.hra
Traceback (most recent call last):
Filenatcap\invest\utils.py”, line 164, in prepare_workspace
Fileinvest\cli.py”, line 469, in main
Filenatcap\invest\hra.py”, line 537, in execute
Filenatcap\invest\hra.py”, line 1948, in _parse_criteria_table
AssertionError: The criteria table is missing these section headers: HABITAT NAME
12/04/2023 13:21:47 natcap.invest.utils INFO Elapsed time: 0.04s
12/04/2023 13:21:47 natcap.invest.utils INFO Execution finished.

After looking into the error, it turns out that this is due to HRA not opening the CSV with the UTF-8-SIG codec.

@phargogh phargogh added bug Something isn't working in progress This issue is actively being worked on labels Dec 5, 2023
@phargogh phargogh self-assigned this Dec 5, 2023
@phargogh phargogh changed the title HRA criteria table fails cryptically when CSV has a BOM HRA criteria table loading fails cryptically when CSV has a BOM Dec 5, 2023
phargogh added a commit to phargogh/invest that referenced this issue Dec 5, 2023
phargogh added a commit to phargogh/invest that referenced this issue Dec 5, 2023
@phargogh
Copy link
Member Author

phargogh commented Dec 5, 2023

Well, this was already fixed by #1334 , but I've added a test for it anyways in #1461

phargogh added a commit to phargogh/invest that referenced this issue Dec 7, 2023
phargogh added a commit to phargogh/invest that referenced this issue Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in progress This issue is actively being worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant