All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cleber Rosa <crosa@redhat.com>
To: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org, ehabkost@redhat.com, quintela@redhat.com
Subject: Re: [PATCH] vmstate-static-checker: Fix for current python
Date: Thu, 21 Nov 2019 14:36:23 -0500 (EST)	[thread overview]
Message-ID: <76600245.13392416.1574364983414.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <20191121185303.51685-1-dgilbert@redhat.com>



----- Original Message -----
> From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
> To: qemu-devel@nongnu.org, quintela@redhat.com, ehabkost@redhat.com, crosa@redhat.com
> Sent: Thursday, November 21, 2019 1:53:03 PM
> Subject: [PATCH] vmstate-static-checker: Fix for current python
> 
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> 
> Python 3.7.5 on f31 doesn't seem to like the old type=file syntax
> on argparse.
> 
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> ---
>  scripts/vmstate-static-checker.py | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/vmstate-static-checker.py
> b/scripts/vmstate-static-checker.py
> index 21dbdccf3e..9f912dd870 100755
> --- a/scripts/vmstate-static-checker.py
> +++ b/scripts/vmstate-static-checker.py
> @@ -379,9 +379,11 @@ def main():
>      help_text = "Parse JSON-formatted vmstate dumps from QEMU in files SRC
>      and DEST.  Checks whether migration from SRC to DEST QEMU versions
>      would break based on the VMSTATE information contained within the JSON
>      outputs.  The JSON output is created from a QEMU invocation with the
>      -dump-vmstate parameter and a filename argument to it.  Other
>      parameters to QEMU do not matter, except the -M (machine type)
>      parameter."
>  
>      parser = argparse.ArgumentParser(description=help_text)
> -    parser.add_argument('-s', '--src', type=file, required=True,
> +    parser.add_argument('-s', '--src', type=argparse.FileType('r'),
> +                        required=True,

Actually, as far back as Python 3.4 (maybe even earlier) `file` is not a
valid built-in function anymore.

>                          help='json dump from src qemu')
> -    parser.add_argument('-d', '--dest', type=file, required=True,
> +    parser.add_argument('-d', '--dest', type=argparse.FileType('r'),
> +                        required=True,
>                          help='json dump from dest qemu')
>      parser.add_argument('--reverse', required=False, default=False,
>                          action='store_true',
> --
> 2.23.0
> 
> 
> 

And I agree that this is 4.2 material.

Reviewed-by: Cleber Rosa <crosa@redhat.com>



      parent reply	other threads:[~2019-11-21 19:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 18:53 [PATCH] vmstate-static-checker: Fix for current python Dr. David Alan Gilbert (git)
2019-11-21 18:58 ` [PATCH-for-4.2?] " Philippe Mathieu-Daudé
2019-11-21 19:36 ` Cleber Rosa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=76600245.13392416.1574364983414.JavaMail.zimbra@redhat.com \
    --to=crosa@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.