question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

test: TestMetrics.test_formatted_output may fail on Windows

See original GitHub issue

It runs successfully on appveyor, but fails on Windows 10 free image with:

E AssertionError: assert ‘\tmetrics.csv:\n\t\tvalor_mse desviación_mse data_set \n\t\t0.421601 0.173461 entrenamiento \n\t\t0.67528 0.289545 pruebas \n\t\t0.671502 0.297848 validación’ in ‘unable to read metric in 'metrics.csv' in branch ''\n\tmetrics.tsv:\n\t\tvalue_mse deviation_mse data_set …\t\t “0.671502”\n\t\t ]\n\t\t}\n\tmetrics.txt:\n\t\tROC_AUC: 0.64\n\t\tKS: 78.9999999996\n\t\tF_SCORE: 77’

Note that “unable to read metric in ‘metrics.csv’ in branch …”, the full error is:

 unable to read metric in 'metrics.csv' in branch ''
Traceback (most recent call last):
  File "E:\dvc\repo\metrics\show.py", line 138, in _read_metric
    return _format_output(fd.read().strip(), typ)
  File "c:\users\user\envs\dvc\lib\codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf3 in position 18: invalid continuation byte

So it’s something about encodongs. Most probably some open() somewhere doesn’t specify encoding and that falls back to system default, say cp1252, which somewhat works for text in the test, but fails later then it’s read as unicode.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Suorcommented, Apr 25, 2019

NOTE: to prevent future errors of this type we may setlocale() globally to use UTF-8.

0reactions
Suorcommented, Apr 26, 2019

P.S. We will also need same wrapper for pathlib.Path.write_text() and pathlib.Path.read_text().

Read more comments on GitHub >

github_iconTop Results From Across the Web

Customizing Code Coverage Analysis - Visual Studio (Windows)
Learn how to use the ExcludeFromCodeCoverageAttribute attribute to exclude test code from coverage results. You can include assemblies ...
Read more >
Unit test reports - GitLab Docs
First, GitLab Runner uploads all JUnit report format XML files as artifacts ... You can copy the name and path of failed tests...
Read more >
Synthetic Monitoring Troubleshooting - Datadog Docs
My mobile small or tablet browser test results keep failing. If your website is using responsive techniques, its DOM might differ a lot...
Read more >
How to Write Test Cases: The Ultimate Guide with Examples
How to Write Test Cases? Basic Format of Test Case Statement. Tips for Writing Tests. #1) Keep it simple but not too simple;...
Read more >
Performance Measures Testing
The FCC performance measures testing framework confirms that broadband ... speed and latency testing of their networks and submit the results to USAC...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found