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

[BUG] csvtokef fails with key error on file with 'UTF-8 with BOM' character encoding #536

Open
Stephen-Veitch opened this issue Aug 5, 2024 · 1 comment · May be fixed by #548
Open
Assignees
Labels

Comments

@Stephen-Veitch
Copy link
Collaborator

Stephen-Veitch commented Aug 5, 2024

Attempting to convert a csv of an offset table from csv to kef when the encoding of the source file is 'UTF-8 with BOM' fails with the following error:

Traceback (most recent call last):
  File "/Users/sveitch/anaconda3/envs/ph5/bin/csvtokef", line 11, in <module>
    load_entry_point('ph5', 'console_scripts', 'csvtokef')()
  File "/Users/sveitch/Documents/code/ph5/PH5/ph5/utilities/csvtokef.py", line 45, in main
    keffile.write("{0}\n".format(kef_dict['table']))

This operation will be successful with simple 'UTF-8' encoding. Excel will write csvs with BOM encoding under certain circumstances (I don't know when/why) so this is an issue that may be likely to come up for other users.

@Stephen-Veitch
Copy link
Collaborator Author

Stephen-Veitch commented Sep 6, 2024

array_v0.utf8.csv
array_v0.utf8bom.csv

Examples of array table csvs with UTF-8 and UTF-8 w/ BOM encodings. File contents are not particularly relevant as these are intended only as examples of working files with these encodings.

@damhuonglan damhuonglan self-assigned this Sep 26, 2024
@damhuonglan damhuonglan linked a pull request Sep 26, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants