[PATCH 03 of 11] py3: raw stringify various things in the LFS server module

Yuya Nishihara yuya at tcha.org
Mon Jan 28 06:58:40 EST 2019


On Mon, 28 Jan 2019 00:20:49 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1548568239 18000
> #      Sun Jan 27 00:50:39 2019 -0500
> # Node ID 9a35d8754bdfaac20d1931dbd6a82233d11f4722
> # Parent  7768ad6f53d8e08e90918e50201fc2fab4f9eff6
> py3: raw stringify various things in the LFS server module

> -    operation = lfsreq.get('operation')
> -    if operation not in ('upload', 'download'):
> +    operation = lfsreq.get(r'operation')
> +    operation = pycompat.bytestr(operation)

If we don't care non-ASCII "operation" value and don't want Unicode exception,
using pycompat.sysbytes() is safer.


More information about the Mercurial-devel mailing list