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

Support binary output diffs #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

CoolCat467
Copy link

This pull request adds support for binary output diffs by using difflib.diff_bytes.

Issue is, we still need to print how output has changed, and print will only do what we want if it's a string object. With a binary format there could be things that are not able to be decoded by utf-8, so using bytes.decode backslashreplace error handler to replace unprintable characters with hexadecimal form of unicode code point.

To be completely honest this might not be necessary, I haven't tried using a string utf-8 can't handle, but it's there so if there is an issue it's already solved.

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.

1 participant