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

fix: always parse HexTuple files as utf-8 #2070

Merged
merged 1 commit into from Aug 7, 2022

Conversation

aucampia
Copy link
Member

@aucampia aucampia commented Aug 2, 2022

Summary of changes

Always parse HexTuple files as utf-8 as was the intent anyway as
evidenced by the code that will raise a warning if the encoding provided
for a HexTuple file is something other than utf-8 or None.

def parse(self, source, graph, **kwargs):
if kwargs.get("encoding") not in [None, "utf-8"]:
warnings.warn(
f"Hextuples files are always utf-8 encoded, "
f"I was passed: {kwargs.get('encoding')}, "
"but I'm still going to use utf-8"
)

Not adding any tests as this code is already tested and an XFAIL is
removed in this patch.

Checklist

  • Checked that there aren't other open pull requests for
    the same change.
  • Checked that all tests and type checking passes.
  • For changes that have a potential impact on users of this project:
    • Considered updating our changelog (CHANGELOG.md).
  • Considered granting push permissions to the PR branch,
    so maintainers can fix minor issues and keep your PR up to date.

Always parse HexTuple files as utf-8 as was the intent anyway as
evidenced by the code that will raise a warning if the encoding provided
for a HexTuple file is something other than utf-8 or None.

https://github.com/RDFLib/rdflib/blob/cfa418074b27b12aac905ba266b002a237c5ff4c/rdflib/plugins/parsers/hext.py#L73-L79

Not adding any tests as this code is already tested and an XFAIL is
removed in this patch.
@aucampia aucampia marked this pull request as ready for review August 2, 2022 22:32
@coveralls
Copy link

Coverage Status

Coverage remained the same at 90.447% when pulling 8c72b6d on aucampia:iwana-20220803T0022-hext_encoding into cfa4180 on RDFLib:master.

@aucampia aucampia requested a review from a team August 2, 2022 22:51
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

👍

@aucampia aucampia merged commit 493241e into RDFLib:master Aug 7, 2022
@aucampia aucampia deleted the iwana-20220803T0022-hext_encoding branch April 9, 2023 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants