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

fixes read of metar file with bad encoding #1272

Merged
merged 1 commit into from Jan 12, 2020

Conversation

kgoebber
Copy link
Collaborator

@kgoebber kgoebber commented Jan 7, 2020

Description Of Changes

In processing the WMO files that come across the LDM feed I was running into problems where there were certain bytes that were not able to be parsed with the UTF-8 decoding. This PR adds a helper to the open file to escape those bytes and allow the read to continue, specifically errors='surrogateescape' in _tools.py. I have added a file that contains that problem and added a test to cover the issue.

Checklist

  • Tests added

@dopplershift dopplershift added Area: IO Pertains to reading data Type: Bug Something is not working like it should labels Jan 7, 2020
@dopplershift dopplershift added this to the 1.0 milestone Jan 7, 2020
Copy link
Member

@dopplershift dopplershift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor change, plus this needs a rebase for tests to pass.

src/metpy/io/_tools.py Outdated Show resolved Hide resolved
@dopplershift
Copy link
Member

Not sure what’s up with coverage—merging over it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: IO Pertains to reading data Type: Bug Something is not working like it should
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants