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

Handle invalid json files #1695

Merged
merged 2 commits into from
Sep 5, 2018
Merged

Conversation

csordasmarton
Copy link
Contributor

No description provided.

@csordasmarton csordasmarton added this to the release 6.8 milestone Aug 2, 2018
@csordasmarton csordasmarton requested a review from gyorb August 2, 2018 12:44
@Ericsson Ericsson deleted a comment Aug 7, 2018
@Ericsson Ericsson deleted a comment Aug 7, 2018
@Ericsson Ericsson deleted a comment Aug 7, 2018
@Ericsson Ericsson deleted a comment Aug 7, 2018
@Ericsson Ericsson deleted a comment Aug 14, 2018
@Ericsson Ericsson deleted a comment Aug 14, 2018
@Ericsson Ericsson deleted a comment Aug 14, 2018
@Ericsson Ericsson deleted a comment Aug 14, 2018
@Ericsson Ericsson deleted a comment Aug 14, 2018
@Ericsson Ericsson deleted a comment Aug 14, 2018
@Ericsson Ericsson deleted a comment Aug 14, 2018
@Ericsson Ericsson deleted a comment Aug 15, 2018
@Ericsson Ericsson deleted a comment Aug 15, 2018
@Ericsson Ericsson deleted a comment Aug 15, 2018
@Ericsson Ericsson deleted a comment Aug 15, 2018
@Ericsson Ericsson deleted a comment Aug 15, 2018
@Ericsson Ericsson deleted a comment Aug 15, 2018
@Ericsson Ericsson deleted a comment Aug 15, 2018
@Ericsson Ericsson deleted a comment Aug 15, 2018
@Ericsson Ericsson deleted a comment Aug 15, 2018
@Ericsson Ericsson deleted a comment Aug 15, 2018
@Ericsson Ericsson deleted a comment Aug 15, 2018
@csordasmarton csordasmarton requested a review from gyorb August 16, 2018 14:46
@Ericsson Ericsson deleted a comment Aug 16, 2018
@Ericsson Ericsson deleted a comment Aug 16, 2018
@Ericsson Ericsson deleted a comment Aug 16, 2018
@Ericsson Ericsson deleted a comment Aug 16, 2018
@Ericsson Ericsson deleted a comment Aug 16, 2018
@Ericsson Ericsson deleted a comment Aug 16, 2018
@@ -570,13 +570,21 @@ def load_json_or_empty(path, default=None, kind=None):
ret = default
try:
with open(path, 'r') as handle:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use io.open

LOG.warning("Failed to open {0} file: {1}"
.format(kind if kind else 'json', path))
except ValueError:
LOG.warning(ex)
except ValueError as ex:
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we get OSError, TypeError or some other exception which should be handled here?

@csordasmarton csordasmarton requested a review from gyorb August 31, 2018 12:13
@Ericsson Ericsson deleted a comment Aug 31, 2018
@Ericsson Ericsson deleted a comment Sep 3, 2018
@Ericsson Ericsson deleted a comment Sep 3, 2018
@Ericsson Ericsson deleted a comment Sep 3, 2018
@Ericsson Ericsson deleted a comment Sep 3, 2018
@Ericsson Ericsson deleted a comment Sep 3, 2018
@Ericsson Ericsson deleted a comment Sep 3, 2018
@gyorb gyorb merged commit 70c4d9a into Ericsson:master Sep 5, 2018
@csordasmarton csordasmarton deleted the handle-invalid-json branch September 11, 2018 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants