Skip to content

More flexible handling of encoding error#10

Open
leojoubert wants to merge 4 commits intohalfak:masterfrom
leojoubert:master
Open

More flexible handling of encoding error#10
leojoubert wants to merge 4 commits intohalfak:masterfrom
leojoubert:master

Conversation

@leojoubert
Copy link
Copy Markdown

No description provided.

Comment thread deltas/apply_get_a.py
@@ -0,0 +1,20 @@
def apply_get_a(operations_diff_file):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

What's the goal of this method? Maybe some docs or a test would be welcome.

Comment thread deltas/apply_get_a.py
raise TypeError("Unexpected operation type " + \
"{0}".format(type(operation)))

return ' '.join(a)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why join everything with a space?

def append(self, subsegment):
super().append(subsegment)
self.sha1.update(bytes(str(subsegment), 'utf-8'))
self.sha1.update(bytes(str(subsegment), 'utf-8', errors = "replace"))
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

+1 this is a good idea.

@halfak halfak force-pushed the master branch 2 times, most recently from c332a77 to 5518f45 Compare May 7, 2020 21:02
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.

2 participants