From owner-freebsd-bugs@FreeBSD.ORG Fri Mar 22 00:00:02 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C2943EE7 for ; Fri, 22 Mar 2013 00:00:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A74A1254 for ; Fri, 22 Mar 2013 00:00:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r2M002rj000408 for ; Fri, 22 Mar 2013 00:00:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r2M002xF000407; Fri, 22 Mar 2013 00:00:02 GMT (envelope-from gnats) Resent-Date: Fri, 22 Mar 2013 00:00:02 GMT Resent-Message-Id: <201303220000.r2M002xF000407@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, hiren panchasara Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 31DE3E18 for ; Thu, 21 Mar 2013 23:51:23 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 24182220 for ; Thu, 21 Mar 2013 23:51:23 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r2LNpMbp061079 for ; Thu, 21 Mar 2013 23:51:22 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id r2LNpMrT061072; Thu, 21 Mar 2013 23:51:22 GMT (envelope-from nobody) Message-Id: <201303212351.r2LNpMrT061072@red.freebsd.org> Date: Thu, 21 Mar 2013 23:51:22 GMT From: hiren panchasara To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: kern/177214: [patch] Issue with r241826 - Covert to python 3 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Mar 2013 00:00:02 -0000 >Number: 177214 >Category: kern >Synopsis: [patch] Issue with r241826 - Covert to python 3 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Mar 22 00:00:02 UTC 2013 >Closed-Date: >Last-Modified: >Originator: hiren panchasara >Release: current >Organization: >Environment: 10.0-CURRENT FreeBSD 10.0-CURRENT #1 r248555: Wed Mar 20 15:00:20 UTC 2013 >Description: r241826 removed raw_input() as its not available in python3. But with python 2.7.3, this change is causing an interesting failure where its not picking newline char. My python foo is not good but I _think_ the patch attached will handle this case. Please modify the patch if/as needed. cheers, Hiren >How-To-Repeat: You should be able to run through all the counters by just pressing return but with raw_input() taken away, thats not happening. It fails right after first counter. /usr/src/tools/test/hwpmc # ./pmctest.py -p ls # p/CLOCK.HARD 2 pmctest.py next? Traceback (most recent call last): File "./pmctest.py", line 98, in main() File "./pmctest.py", line 90, in main value = input("next?") File "", line 0 ^ SyntaxError: unexpected EOF while parsing root@testhaswell:/usr/src/tools/test/hwpmc # >Fix: Index: tools/test/hwpmc/pmctest.py =================================================================== --- tools/test/hwpmc/pmctest.py (revision 248555) +++ tools/test/hwpmc/pmctest.py (working copy) @@ -51,6 +51,9 @@ import subprocess from subprocess import PIPE +# Use input() for Python version 3 +if sys.version_info[0] == 3: + raw_input = input + # A list of strings that are not really counters, just # name tags that are output by pmccontrol -L notcounter = ["IAF", "IAP", "TSC", "UNC", "UCF", "UCP", "SOFT" ] @@ -87,7 +90,7 @@ print(result) if (options.wait == True): try: - value = input("next?") + value = raw_input("next?") except EOFError: sys.exit() >Release-Note: >Audit-Trail: >Unformatted: