From patchwork Tue Jul 24 07:33:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jianhong Yin X-Patchwork-Id: 10541415 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 18794184F for ; Tue, 24 Jul 2018 07:34:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F17912875E for ; Tue, 24 Jul 2018 07:34:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E62CC28761; Tue, 24 Jul 2018 07:34:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83D552875E for ; Tue, 24 Jul 2018 07:34:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388391AbeGXIjW (ORCPT ); Tue, 24 Jul 2018 04:39:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:54704 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388421AbeGXIjW (ORCPT ); Tue, 24 Jul 2018 04:39:22 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6952883221; Tue, 24 Jul 2018 07:34:14 +0000 (UTC) Received: from dhcp-12-115.nay.redhat.com (unknown [10.66.12.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id D1F64178B4; Tue, 24 Jul 2018 07:34:12 +0000 (UTC) From: jiyin@redhat.com To: bfields@redhat.com Cc: linux-nfs@vger.kernel.org, "Jianhong.Yin" Subject: [PATCH 12/24] pynfs: python3 support plan: file() -> open() Date: Tue, 24 Jul 2018 15:33:30 +0800 Message-Id: <20180724073342.5738-12-jiyin@redhat.com> In-Reply-To: <20180724073342.5738-1-jiyin@redhat.com> References: <20180724073342.5738-1-jiyin@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 24 Jul 2018 07:34:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 24 Jul 2018 07:34:14 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jiyin@redhat.com' RCPT:'' Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "Jianhong.Yin" Signed-off-by: Jianhong Yin --- nfs4.0/testserver.py | 2 +- nfs4.1/testclient.py | 2 +- nfs4.1/testserver.py | 2 +- showresults.py | 2 +- xdr/xdrgen.py | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nfs4.0/testserver.py b/nfs4.0/testserver.py index 96012a1..fcee8e9 100755 --- a/nfs4.0/testserver.py +++ b/nfs4.0/testserver.py @@ -354,7 +354,7 @@ def main(): print(sys.exc_info()[1]) sys.exit(1) if opt.outfile is not None: - fd = file(opt.outfile, 'w') + fd = open(opt.outfile, 'w') try: clean_finish = False testmod.runtests(tests, opt, env, run_filter) diff --git a/nfs4.1/testclient.py b/nfs4.1/testclient.py index 1027fa6..47b74bd 100755 --- a/nfs4.1/testclient.py +++ b/nfs4.1/testclient.py @@ -313,7 +313,7 @@ def main(): print(sys.exc_info()[1]) sys.exit(1) if opt.outfile is not None: - fd = file(opt.outfile, 'w') + fd = open(opt.outfile, 'w') try: clean_finish = False testmod.runtests(tests, opt, env, run_filter) diff --git a/nfs4.1/testserver.py b/nfs4.1/testserver.py index 101cfb1..c21221e 100755 --- a/nfs4.1/testserver.py +++ b/nfs4.1/testserver.py @@ -333,7 +333,7 @@ def main(): print(sys.exc_info()[1]) sys.exit(1) if opt.outfile is not None: - fd = file(opt.outfile, 'w') + fd = open(opt.outfile, 'w') try: clean_finish = False testmod.runtests(tests, opt, env, run_filter) diff --git a/showresults.py b/showresults.py index 962407d..ed23f7b 100755 --- a/showresults.py +++ b/showresults.py @@ -38,7 +38,7 @@ class MyUnpickler(pickle.Unpickler): return self.Unknown(name) def show(filename, opt): - fd = file(filename, 'r') + fd = open(filename, 'r') p = MyUnpickler(fd) tests = p.load() testmod.printresults(tests, opt) diff --git a/xdr/xdrgen.py b/xdr/xdrgen.py index b5119cc..bed2181 100755 --- a/xdr/xdrgen.py +++ b/xdr/xdrgen.py @@ -1419,12 +1419,12 @@ def run(infile, filters=True, pass_attrs=True, debug=False): comment_string = "# Generated by rpcgen.py from %s on %s\n" % \ (infile, time.asctime()) - const_fd = file(constants_file + ".py", "w") + const_fd = open(constants_file + ".py", "w") const_fd.write(comment_string) - type_fd = file(types_file + ".py", "w") + type_fd = open(types_file + ".py", "w") type_fd.write(comment_string) type_fd.write("import %s as const\n" % constants_file) - pack_fd = file(packer_file + ".py", "w") + pack_fd = open(packer_file + ".py", "w") pack_fd.write(comment_string) pack_fd.write(pack_header % (constants_file, types_file)) pack_fd.write(pack_init % name_base.upper())