Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5466601imu; Sun, 20 Jan 2019 11:30:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN7KPNpHo+g1CiM8AcS3gjGqEkZS0CXAjSofv+YntbOGEJ+574Qpgzkd/9DoDaknV1bPn3hm X-Received: by 2002:a63:34c3:: with SMTP id b186mr24759545pga.184.1548012657789; Sun, 20 Jan 2019 11:30:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548012657; cv=none; d=google.com; s=arc-20160816; b=PmJyt/hyT8DkyHmK7MM4w563KLAunAfZUDsr4g2Of0nnuK0YzMJGNxZWWOv/HRbRQB CTJ5zNr7jaSWcwc+3xDjwwNqGmf914qwNiV90UwoSzArjJX1t70mtt1/amh4tZy+Vruh 7/VPg9TQGITjxKuM5nhuRQiLvdZ3oFdOAJ/M6RVPsdjYS7DUWe9UjLukT5GvCeQYOYd/ VKH5u/yl3yMT2jPJlM8RCrjGhKOU/HGV2MNmSTSXx8QXHM3ySaXuzo8sifwQwciJvYeC aYxuahal8DMgoT7hMDd/dLfW2m3UBlNSmO2qfFExzWEAJE1pnWVcxOOqTOonEvgnKAfN +S8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=6HKMNRJcxA1fUGxNo0qKVU9/e0xduxS6saI1JYWtxKA=; b=kL6ZCjhauLbY40pPJWiiLy19pK8cL70KL0IjpYLunoqetcb0G0UiQ7J2H5Tneracfj ZRrvtmK2TphZqBgsmmZkR0gN95gLWq4FpnOLBzpYwaP+3WgccYBwXjeVFAfcrMmnTj0i NYtCjY57T2kubHloT6NnXpulLdhz9M2+y/6+qAwcvj/0Y71MRoAwsKXsuuv73pfi4SOs DHcpoyjx5P9HHCWFCkePr9R9C+2HXOitBHi6Dp9qUChP5ob4LGAL7AbpvF6EtIueNgS0 0Vl5T/3X6wK3pPqG54xgKGOXjQe+Q603dUo/lhZ6O1hJbz2KZqU3gMTM5kk7Tcv/ZgoT ZQBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j191si10926425pgd.31.2019.01.20.11.30.42; Sun, 20 Jan 2019 11:30:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727663AbfATT2C (ORCPT + 99 others); Sun, 20 Jan 2019 14:28:02 -0500 Received: from ms.lwn.net ([45.79.88.28]:58932 "EHLO ms.lwn.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727518AbfATT2C (ORCPT ); Sun, 20 Jan 2019 14:28:02 -0500 Received: from localhost.localdomain (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ms.lwn.net (Postfix) with ESMTPSA id 2D41A7DE; Sun, 20 Jan 2019 19:27:59 +0000 (UTC) Date: Sun, 20 Jan 2019 12:27:55 -0700 From: Jonathan Corbet To: Tony Jones Cc: Seeteena Thoufeek , peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] perf scripts python: Add Python 3 support to exported-sql-viewer.py Message-ID: <20190120122755.1a8fe456@lwn.net> In-Reply-To: References: <1547718344-27382-1-git-send-email-s1seetee@linux.vnet.ibm.com> <1547718344-27382-3-git-send-email-s1seetee@linux.vnet.ibm.com> Organization: LWN.net X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 18 Jan 2019 16:45:04 -0800 Tony Jones wrote: > On 1/17/19 1:45 AM, Seeteena Thoufeek wrote: > > > +if sys.version_info[0] < 3: > > + import cPickle > > +else: > > + import _pickle as cPickle > > Do you really need this? > > pickle is already in Python2. Did you mean in Python3? I would agree that using it is better than importing the semi-hidden _pickle module. That said, I'll echo the questions about testing. Pickle works in Python3, but it is fraught with all kinds of bytes/str and encoding issues; I've found it sufficiently fragile in practice that I really just try to avoid it. How have you verified that this script works under both versions of Python? Thanks, jon