Python 3 compatibility fun

Started by Tom Laneabout 10 years ago4 messages
#1Tom Lane
tgl@sss.pgh.pa.us

According to
https://bugzilla.redhat.com/show_bug.cgi?id=1280404

we're failing to build against Python 3.5 because the python guys
have randomly changed some error message texts, again.

In the short run the answer must be to add some more variant
expected-files, but I wonder if we should be looking for another way.

One question worth asking is whether these specific test cases are
worth having at all ... they don't look all that useful to me.

regards, tom lane

*** /builddir/build/BUILD/postgresql-9.4.5/src/pl/plpython/expected/python3/plpython_error.out	Wed Nov 11 14:44:44 2015
--- /builddir/build/BUILD/postgresql-9.4.5/src/pl/plpython/results/python3/plpython_error.out	Wed Nov 11 14:44:51 2015
***************
*** 245,251 ****
  plpy.nonexistent
  $$ LANGUAGE plpython3u;
  SELECT toplevel_attribute_error();
! ERROR:  AttributeError: 'module' object has no attribute 'nonexistent'
  CONTEXT:  Traceback (most recent call last):
    PL/Python function "toplevel_attribute_error", line 2, in <module>
      plpy.nonexistent
--- 245,251 ----
  plpy.nonexistent
  $$ LANGUAGE plpython3u;
  SELECT toplevel_attribute_error();
! ERROR:  AttributeError: module 'plpy' has no attribute 'nonexistent'
  CONTEXT:  Traceback (most recent call last):
    PL/Python function "toplevel_attribute_error", line 2, in <module>
      plpy.nonexistent
======================================================================
*** /builddir/build/BUILD/postgresql-9.4.5/src/pl/plpython/expected/python3/plpython_subtransaction.out	Wed Nov 11 14:44:44 2015
--- /builddir/build/BUILD/postgresql-9.4.5/src/pl/plpython/results/python3/plpython_subtransaction.out	Wed Nov 11 14:44:51 2015
***************
*** 58,64 ****
  TRUNCATE subtransaction_tbl;
  SELECT subtransaction_test('Python');
! ERROR:  AttributeError: 'module' object has no attribute 'attribute_error'
  CONTEXT:  Traceback (most recent call last):
    PL/Python function "subtransaction_test", line 13, in <module>
      plpy.attribute_error
--- 58,64 ----

TRUNCATE subtransaction_tbl;
SELECT subtransaction_test('Python');
! ERROR: AttributeError: module 'plpy' has no attribute 'attribute_error'
CONTEXT: Traceback (most recent call last):
PL/Python function "subtransaction_test", line 13, in <module>
plpy.attribute_error
***************
*** 110,116 ****

  TRUNCATE subtransaction_tbl;
  SELECT subtransaction_ctx_test('Python');
! ERROR:  AttributeError: 'module' object has no attribute 'attribute_error'
  CONTEXT:  Traceback (most recent call last):
    PL/Python function "subtransaction_ctx_test", line 8, in <module>
      plpy.attribute_error
--- 110,116 ----

TRUNCATE subtransaction_tbl;
SELECT subtransaction_ctx_test('Python');
! ERROR: AttributeError: module 'plpy' has no attribute 'attribute_error'
CONTEXT: Traceback (most recent call last):
PL/Python function "subtransaction_ctx_test", line 8, in <module>
plpy.attribute_error
======================================================================

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#1)
Re: Python 3 compatibility fun

On 11/11/15 12:08 PM, Tom Lane wrote:

we're failing to build against Python 3.5 because the python guys
have randomly changed some error message texts, again.

This has already been fixed in the 9.5.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#2)
Re: Python 3 compatibility fun

Peter Eisentraut <peter_e@gmx.net> writes:

On 11/11/15 12:08 PM, Tom Lane wrote:

we're failing to build against Python 3.5 because the python guys
have randomly changed some error message texts, again.

This has already been fixed in the 9.5.

Well, that's nice, but surely it should have been back-patched into
every branch that claims to support Python 3.x. We cannot pretend
that the world is not a moving target.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#3)
Re: Python 3 compatibility fun

On 11/11/15 1:49 PM, Tom Lane wrote:

Peter Eisentraut <peter_e@gmx.net> writes:

On 11/11/15 12:08 PM, Tom Lane wrote:

we're failing to build against Python 3.5 because the python guys
have randomly changed some error message texts, again.

This has already been fixed in the 9.5.

Well, that's nice, but surely it should have been back-patched into
every branch that claims to support Python 3.x. We cannot pretend
that the world is not a moving target.

I have backpatched this to 9.4, 9.3, 9.2 now. 9.1 doesn't pass with 3.4
either.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers