Re: [PATCH v3] py3: properly reject non-encoded strings given to hgweb

2019-04-28 Thread Yuya Nishihara
On Sun, 28 Apr 2019 04:22:53 +, Ludovic Chabant wrote:
> # HG changeset patch
> # User Ludovic Chabant 
> # Date 1555683992 0
> #  Fri Apr 19 14:26:32 2019 +
> # Branch stable
> # Node ID 6805ebb0f1f6a7f34a74732ee6f6ec14e8824e42
> # Parent  3611368a1af3037427eb59635c7dad8dab67c606
> py3: properly reject non-encoded strings given to hgweb

Queued, thanks.

> diff --git a/mercurial/hgweb/__init__.py b/mercurial/hgweb/__init__.py
> --- a/mercurial/hgweb/__init__.py
> +++ b/mercurial/hgweb/__init__.py
> @@ -13,6 +13,7 @@
>  from ..i18n import _
>  
>  from .. import (
> +encoding,

Dropped this.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH v3] py3: properly reject non-encoded strings given to hgweb

2019-04-27 Thread Ludovic Chabant
# HG changeset patch
# User Ludovic Chabant 
# Date 1555683992 0
#  Fri Apr 19 14:26:32 2019 +
# Branch stable
# Node ID 6805ebb0f1f6a7f34a74732ee6f6ec14e8824e42
# Parent  3611368a1af3037427eb59635c7dad8dab67c606
py3: properly reject non-encoded strings given to hgweb

diff --git a/mercurial/hgweb/__init__.py b/mercurial/hgweb/__init__.py
--- a/mercurial/hgweb/__init__.py
+++ b/mercurial/hgweb/__init__.py
@@ -13,6 +13,7 @@
 from ..i18n import _
 
 from .. import (
+encoding,
 error,
 pycompat,
 )
@@ -38,6 +39,9 @@
 - list of virtual:real tuples (multi-repo view)
 '''
 
+if isinstance(config, pycompat.unicode):
+raise error.ProgrammingError(
+'Mercurial only supports encoded strings: %r' % config)
 if ((isinstance(config, bytes) and not os.path.isdir(config)) or
 isinstance(config, dict) or isinstance(config, list)):
 # create a multi-dir interface
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel