Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WmklI-0003a9-Is for pgsql-bugs@arkaria.postgresql.org; Tue, 20 May 2014 14:11:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WmklI-0005qF-0n for pgsql-bugs@arkaria.postgresql.org; Tue, 20 May 2014 14:11:24 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WmklH-0005q9-9x for pgsql-bugs@postgresql.org; Tue, 20 May 2014 14:11:23 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WmklE-0003HS-P7 for pgsql-bugs@postgresql.org; Tue, 20 May 2014 14:11:22 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4KEBIUH031121 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 20 May 2014 10:11:18 -0400 Received: from hhorak-t440.usersys.redhat.com (unused-4-162.brq.redhat.com [10.34.4.162]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s4KEBGm1016184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 20 May 2014 10:11:17 -0400 Message-ID: <537B6283.90501@redhat.com> Date: Tue, 20 May 2014 16:11:15 +0200 From: Honza Horak User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org CC: Bohuslav Kabrda , Jozef Mlich Subject: postgresql test failure with Python 3.4.0 in plpython_do References: <1509291848.14235127.1400590348512.JavaMail.zimbra@redhat.com> In-Reply-To: <1509291848.14235127.1400590348512.JavaMail.zimbra@redhat.com> X-Forwarded-Message-Id: <1509291848.14235127.1400590348512.JavaMail.zimbra@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-Pg-Spam-Score: -7.6 (-------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Hi guys, Slavek is preparing Python 3.4 into Fedora and had some issues with python3/plpython_do test. His analysis is below. As for the fix, I'm not sure if the test suite is capable of being flexible for such error messages, but if the purpose of the test was to get any traceback, we might be fine with changing the error traceback to e.g. >>> raise Exception('error occurred') Traceback (most recent call last): File "", line 1, in Exception: error occurred If any assistance with testing or preparing a patch is required, just ask. Regards, Honza -------- Original Message -------- Subject: postgresql test failure with Python 3.4.0 in plpython_do Date: Tue, 20 May 2014 08:52:28 -0400 (EDT) From: Bohuslav Kabrda To: Honza Horak Diff of expected and actual result: [bkabrda@zizalka plpython]$ diff -u expected/python3/plpython_do.out results/python3/plpython_do.out --- expected/python3/plpython_do.out 2014-05-20 14:09:44.118369434 +0200 +++ results/python3/plpython_do.out 2014-05-20 12:37:01.522028783 +0200 @@ -5,7 +5,7 @@ NOTICE: This is plpython2u. CONTEXT: PL/Python anonymous code block DO $$ nonsense $$ LANGUAGE plpython3u; -ERROR: NameError: global name 'nonsense' is not defined +ERROR: NameError: name 'nonsense' is not defined CONTEXT: Traceback (most recent call last): PL/Python anonymous code block, line 1, in nonsense IIUC the plpython postgresql extension takes the Python code, creates a function of it and then executes it. This is problem, since the error message for undefined names *inside functions* (not for undefined names on global level) has changed (fixed actually, the new version makes more sense IMO) in Python 3.4 compared to 3.3. An example, first Python 3.3: Python 3.3.2 (default, Mar 5 2014, 08:21:05) [GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> def foo(): ... nonsense ... >>> foo() Traceback (most recent call last): File "", line 1, in File "", line 2, in foo NameError: global name 'nonsense' is not defined Now on Python 3.4: Python 3.4.0 (default, May 18 2014, 22:59:00) [GCC 4.9.0 20140514 (Red Hat 4.9.0-4)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> def foo(): ... nonsense ... >>> foo() Traceback (most recent call last): File "", line 1, in File "", line 2, in foo NameError: name 'nonsense' is not defined Note that in Python 3.4, the "global" word is missing, which causes the failure. Perhaps the result file could contain a regexp that would match both or a python3.4 variant of the result could be added? Slavek -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs