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

Suppress warning for not using custom encoding. #800

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rdflib/plugins/serializers/nquads.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, store):
def serialize(self, stream, base=None, encoding=None, **args):
if base is not None:
warnings.warn("NQuadsSerializer does not support base.")
if encoding is not None:
if encoding is not None and encoding.lower() != self.encoding.lower():
warnings.warn("NQuadsSerializer does not use custom encoding.")
encoding = self.encoding
for context in self.store.contexts():
Expand Down
2 changes: 1 addition & 1 deletion rdflib/plugins/serializers/nt.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, store):
def serialize(self, stream, base=None, encoding=None, **args):
if base is not None:
warnings.warn("NTSerializer does not support base.")
if encoding is not None:
if encoding is not None and encoding.lower() != self.encoding.lower():
warnings.warn("NTSerializer does not use custom encoding.")
encoding = self.encoding
for triple in self.store:
Expand Down