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

Set input encoding to UTF-8 to fix parsing issues. #1470

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

SamFlt
Copy link
Contributor

@SamFlt SamFlt commented Sep 25, 2024

This PR tries to fix #1391, by forcing utf-8 decoding when reading headers before generating the bindings.

The issue can be seen in the generation log:

ERROR:root:Traceback (most recent call last):
  File "E:\user\visp-conda-ws\lib\site-packages\visp_python_bindgen\generator.py", line 54, in header_preprocess
    header.preprocess()
  File "E:\user\visp-conda-ws\lib\site-packages\visp_python_bindgen\header.py", line 110, in preprocess
    self.preprocessed_header_str = self.run_preprocessor() # Run preprocessor, get only code that can be compiled with current visp
  File "E:\uservisp-conda-ws\lib\site-packages\visp_python_bindgen\header.py", line 148, in run_preprocessor
    for line in input_header_file.readlines():
UnicodeDecodeError: 'gbk' codec can't decode byte 0x99 in position 4482: illegal multibyte sequence

ERROR:root:<class 'UnicodeDecodeError'>

Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.00%. Comparing base (0a5ef8d) to head (c14edae).
Report is 80 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1470      +/-   ##
==========================================
+ Coverage   45.25%   54.00%   +8.74%     
==========================================
  Files        1121      442     -679     
  Lines      112131    50841   -61290     
  Branches    19077        0   -19077     
==========================================
- Hits        50750    27457   -23293     
+ Misses      61381    23384   -37997     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fspindle fspindle merged commit 27a552c into lagadic:master Oct 1, 2024
79 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.

Cannot create python bindings on windows
2 participants