Mercurial > hgrepos > Python > apps > py-cutils
changeset 343:b3931b511ed0
Also encode TAB characters specially for output in digest files.
Because with the new tabular output style we have the TAB character as column
separator.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Tue, 01 Apr 2025 12:15:05 +0200 |
| parents | 4a8026cbcecf |
| children | 0a58948df713 |
| files | cutils/util/walk.py |
| diffstat | 1 files changed, 8 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/cutils/util/walk.py Tue Apr 01 11:20:22 2025 +0200 +++ b/cutils/util/walk.py Tue Apr 01 12:15:05 2025 +0200 @@ -151,11 +151,13 @@ if isinstance(what, bytes): s = (what.replace(b'\\', b"\\x5c") .replace(b'\n', b"\\x0a") - .replace(b'\r', b"\\x0d")) + .replace(b'\r', b"\\x0d") + .replace(b'\t', b"\\x09")) else: s = (what.replace(u'\\', u"\\x5c") .replace(u'\n', u"\\x0a") - .replace(u'\r', u"\\x0d")) + .replace(u'\r', u"\\x0d") + .replace(u'\t', u"\\x09")) if PY2: if isinstance(s, bytes): return s @@ -258,11 +260,13 @@ if isinstance(what, bytes): s = (what.replace(b'\\', b"\\x5c") .replace(b'\n', b"\\x0a") - .replace(b'\r', b"\\x0d")) + .replace(b'\r', b"\\x0d") + .replace(b'\t', b"\\x09")) else: s = (what.replace(u'\\', u"\\x5c") .replace(u'\n', u"\\x0a") - .replace(u'\r', u"\\x0d")) + .replace(u'\r', u"\\x0d") + .replace(u'\t', u"\\x09")) if PY2: if isinstance(s, bytes): try:
