-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix(dashboard): fix error in windows for csvreader #3806
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3806 +/- ##
==========================================
+ Coverage 85.51% 85.53% +0.02%
==========================================
Files 731 731
Lines 22659 22661 +2
==========================================
+ Hits 19376 19384 +8
+ Misses 3283 3277 -6 ☔ View full report in Codecov by Sentry. |
dashboard/pages/compliance.py
Outdated
@@ -37,7 +37,7 @@ | |||
|
|||
csv_files = [] | |||
for file in glob.glob(os.path.join(folder_path_compliance, "*.csv")): | |||
with open(file, "r", newline="") as csvfile: | |||
with open(file, "r", newline="", encoding="utf-8") as csvfile: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add the encoding in the config and the use it here? The same for the other file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I´ve already done it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch!
Context
Fixes #3766
Description
Windows was having some problems with the encoding from csv files, adding
encoding="utf-8"
when a csv file is opened fixes it.License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.