qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] scripts: Fix undefinited name 'file' error for python3


From: Han Han
Subject: Re: [PATCH] scripts: Fix undefinited name 'file' error for python3
Date: Wed, 4 Dec 2019 16:34:20 +0800



On Wed, Dec 4, 2019 at 4:23 PM Thomas Huth <address@hidden> wrote:
On 04/12/2019 07.48, Han Han wrote:
> Anyone help to review it?

 Hi!

When sending patches to the qemu-devel mailing list, please always make
sure to put the corresponding maintainers on CC:, otherwise your mails
might get lost in the high traffic of the mailing list. For this case,
it would have been good to CC: the "Migration" and "Python script"
maintainers, see the corresponding sections of the MAINTAINERS file in
the top most directory of the QEMU sources.
OK. Thanks for your advice

Anyway, it seems someone else ran into the same issue already, too, and
 it got already fixed here:

https://git.qemu.org/?p=qemu.git;a=commitdiff;h=e8d0ac5801edda91412e5

  Thomas


> On Tue, Nov 26, 2019 at 1:54 PM Han Han <address@hidden
> <mailto:address@hidden>> wrote:
>
>     ping
>
>     On Wed, Nov 13, 2019 at 9:17 PM Han Han <address@hidden
>     <mailto:address@hidden>> wrote:
>
>         In python3, 'file' is no longer a keyword for file type object.
>         So it
>         will can error when run the scripts by python3:
>
>         $ python3 ./scripts/vmstate-static-checker.py -s 4.0.json -d
>         4.1.json
>         Traceback (most recent call last):
>           File "./scripts/vmstate-static-checker.py", line 431, in <module>
>             sys.exit(main())
>           File "./scripts/vmstate-static-checker.py", line 378, in main
>             parser.add_argument('-s', '--src', type=file, required=True,
>         NameError: name 'file' is not defined
>
>         Replace file type to argparse.FileType('r').
>
>         Signed-off-by: Han Han <address@hidden <mailto:address@hidden>>
>         ---
>          scripts/vmstate-static-checker.py | 4 ++--
>          1 file changed, 2 insertions(+), 2 deletions(-)
>
>         diff --git a/scripts/vmstate-static-checker.py
>         b/scripts/vmstate-static-checker.py
>         index d3467288..14f199a0 100755
>         --- a/scripts/vmstate-static-checker.py
>         +++ b/scripts/vmstate-static-checker.py
>         @@ -375,9 +375,9 @@ 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,
>                                  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=""> >         --
>         2.23.0
>
>
>
> --
> Best regards,
> -----------------------------------
> Han Han
> Quality Engineer
> Redhat.
>
> Email: address@hidden <mailto:address@hidden>
> Phone: +861065339333



--
Best regards,
-----------------------------------
Han Han
Quality Engineer
Redhat.

Email: address@hidden
Phone: +861065339333

reply via email to

[Prev in Thread] Current Thread [Next in Thread]