lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 18 Jan 2019 17:05:06 -0800
From:   Tony Jones <tonyj@...e.de>
To:     Seeteena Thoufeek <s1seetee@...ux.vnet.ibm.com>,
        peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
        alexander.shishkin@...ux.intel.com, jolsa@...hat.com,
        namhyung@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] perf scripts python: Add Python 3 support to
 export-to-sqlite.py

On 1/17/19 1:45 AM, Seeteena Thoufeek wrote:
> Support both Python 2 and Python 3 in export-to-sqlite.py. ``print`` is
> now a function rather than a statement. This should have no functional
> change.

I don't see any changes handling the following:

$ git annotate tools/perf/scripts/python/export-to-sqlite.py | grep ">> sys"
564b9527d1ccf	(Adrian Hunter	2017-08-03 11:31:28 +0300	64)	print >> sys.stderr, "Usage is: export-to-sqlite.py <database name> [<columns>] [<calls>] [<callchains>]"
564b9527d1ccf	(Adrian Hunter	2017-08-03 11:31:28 +0300	65)	print >> sys.stderr, "where:	columns		'all' or 'branches'"
564b9527d1ccf	(Adrian Hunter	2017-08-03 11:31:28 +0300	66)	print >> sys.stderr, "		calls		'calls' => create calls and call_paths table"
564b9527d1ccf	(Adrian Hunter	2017-08-03 11:31:28 +0300	67)	print >> sys.stderr, "		callchains	'callchains' => create call_paths table"

$ echo 'import sys ; print >> sys.stderr, "Usage is: exported-sql-viewer.py {<database name> | --help-only}"' | python2
Usage is: exported-sql-viewer.py {<database name> | --help-only}

$ echo 'import sys ; print >> sys.stderr, "Usage is: exported-sql-viewer.py {<database name> | --help-only}"' | python3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for >>: 'builtin_function_or_method' and '_io.TextIOWrapper'. Did you mean "print(<message>, file=<output_stream>)"?


They are best handled via conversion to sys.stderr.write() since sys is already imported.

Tony

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ