lkml.org 
[lkml]   [2019]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] perf scripts python: Add Python 3 support to exported-sql-viewer.py
On Fri, 18 Jan 2019 16:45:04 -0800
Tony Jones <tonyj@suse.de> 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

\
 
 \ /
  Last update: 2019-01-20 20:28    [W:0.106 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site