otherwise ch is the int value of the byte in py3 rather than the actual
character
Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHGe7b84ffb06d9: py3: use pycompat.iterbytestr to convert memoryview slice to bytestring
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
Queued most of the patches in this series, thanks.
- symbol = b''.join(itertools.takewhile(lambda ch: ch not in special,
- view[pos:]))
+ symbol = b''.join(pycompat.iterbytestr(itertools.takewhile(
+ lambda ch: ch not in special,
+ view[pos:]
It's probably better to apply iterbytestr() to view[pos:] so ch is
always a byte string.