Patchwork [1,of,3] pycompat: correct the shlex.split() proxy method signature in py3

login
register
mail settings
Submitter Matt Harbison
Date Feb. 21, 2018, 4:32 a.m.
Message ID <50a2885e94783ecce082.1519187572@Envy>
Download mbox | patch
Permalink /patch/28175/
State Accepted
Headers show

Comments

Matt Harbison - Feb. 21, 2018, 4:32 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1519180650 18000
#      Tue Feb 20 21:37:30 2018 -0500
# Node ID 50a2885e94783ecce0820a08dd40d26cadbf0ae1
# Parent  aefb75730ea34f545f0756bf8441fc9ae07bf8dc
pycompat: correct the shlex.split() proxy method signature in py3
Matt Harbison - Feb. 21, 2018, 5:56 a.m.
> On Feb 20, 2018, at 11:32 PM, Matt Harbison <mharbison72@gmail.com> wrote:
> 
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1519180650 18000
> #      Tue Feb 20 21:37:30 2018 -0500
> # Node ID 50a2885e94783ecce0820a08dd40d26cadbf0ae1
> # Parent  aefb75730ea34f545f0756bf8441fc9ae07bf8dc
> pycompat: correct the shlex.split() proxy method signature in py3
> 
> diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
> --- a/mercurial/pycompat.py
> +++ b/mercurial/pycompat.py
> @@ -261,7 +261,7 @@
>         return dic
> 
>     # TODO: handle shlex.shlex().
> -    def shlexsplit(s):
> +    def shlexsplit(s, comments=False, posix=True):
>         """
>         Takes bytes argument, convert it to str i.e. unicodes, pass that into
>         shlex.split(), convert the returned value to bytes and return that for

Oops.  I forgot to forward the arguments to the actual call...
Yuya Nishihara - Feb. 21, 2018, 11:28 a.m.
On Wed, 21 Feb 2018 00:56:12 -0500, Matt Harbison wrote:
> 
> > On Feb 20, 2018, at 11:32 PM, Matt Harbison <mharbison72@gmail.com> wrote:
> > 
> > # HG changeset patch
> > # User Matt Harbison <matt_harbison@yahoo.com>
> > # Date 1519180650 18000
> > #      Tue Feb 20 21:37:30 2018 -0500
> > # Node ID 50a2885e94783ecce0820a08dd40d26cadbf0ae1
> > # Parent  aefb75730ea34f545f0756bf8441fc9ae07bf8dc
> > pycompat: correct the shlex.split() proxy method signature in py3
> > 
> > diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
> > --- a/mercurial/pycompat.py
> > +++ b/mercurial/pycompat.py
> > @@ -261,7 +261,7 @@
> >         return dic
> > 
> >     # TODO: handle shlex.shlex().
> > -    def shlexsplit(s):
> > +    def shlexsplit(s, comments=False, posix=True):
> >         """
> >         Takes bytes argument, convert it to str i.e. unicodes, pass that into
> >         shlex.split(), convert the returned value to bytes and return that for
> 
> Oops.  I forgot to forward the arguments to the actual call...

Fixed.

Queued 1 and 3, thanks.

Patch

diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -261,7 +261,7 @@ 
         return dic
 
     # TODO: handle shlex.shlex().
-    def shlexsplit(s):
+    def shlexsplit(s, comments=False, posix=True):
         """
         Takes bytes argument, convert it to str i.e. unicodes, pass that into
         shlex.split(), convert the returned value to bytes and return that for