-
Notifications
You must be signed in to change notification settings - Fork 385
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
csordasmarton
force-pushed
the
handle-invalid-json
branch
from
August 7, 2018 09:45
cd80c8a
to
a1e660a
Compare
csordasmarton
force-pushed
the
handle-invalid-json
branch
from
August 14, 2018 09:01
a1e660a
to
d01bef8
Compare
csordasmarton
force-pushed
the
handle-invalid-json
branch
from
August 15, 2018 07:08
d01bef8
to
1cbae59
Compare
csordasmarton
force-pushed
the
handle-invalid-json
branch
from
August 15, 2018 07:25
1cbae59
to
3b36e77
Compare
csordasmarton
force-pushed
the
handle-invalid-json
branch
from
August 16, 2018 14:46
3b36e77
to
fbe749d
Compare
gyorb
suggested changes
Aug 31, 2018
libcodechecker/util.py
Outdated
@@ -570,13 +570,21 @@ def load_json_or_empty(path, default=None, kind=None): | |||
ret = default | |||
try: | |||
with open(path, 'r') as handle: |
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.
Please use io.open
libcodechecker/util.py
Outdated
LOG.warning("Failed to open {0} file: {1}" | ||
.format(kind if kind else 'json', path)) | ||
except ValueError: | ||
LOG.warning(ex) | ||
except ValueError as ex: |
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 we get OSError
, TypeError
or some other exception which should be handled here?
csordasmarton
force-pushed
the
handle-invalid-json
branch
from
August 31, 2018 12:12
fbe749d
to
6b68602
Compare
csordasmarton
force-pushed
the
handle-invalid-json
branch
from
September 3, 2018 13:29
6b68602
to
42330a1
Compare
gyorb
approved these changes
Sep 5, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.