Re: plpython fails its regression test - Mailing list pgsql-hackers

From Tom Lane
Subject Re: plpython fails its regression test
Date
Msg-id 351.1043968159@sss.pgh.pa.us
Whole thread Raw
In response to Re: plpython fails its regression test  (Greg Copeland <greg@CopelandConsulting.Net>)
Responses Re: plpython fails its regression test  (Greg Copeland <greg@CopelandConsulting.Net>)
List pgsql-hackers
Greg Copeland <greg@copelandconsulting.net> writes:
> On Thu, 2003-01-30 at 16:39, Tom Lane wrote:
>> In CVS tip, if you run "make installcheck" in src/pl/plpython, the test
>> fails with a number of diffs between the expected and actual output.

> Could this have anything to do with the changes I made to the python
> stuff to get it to support longs (IIRC)?

The diffs seem to have more to do with error handling --- see attached.

None of the plpython files have changed since November, btw, so I would
imagine you'll see the same behavior in 7.3 or 7.3.1; but I haven't
rebuilt that branch to confirm it.
        regards, tom lane


--- error.expected    2002-03-06 13:50:31.000000000 -0500
+++ error.output    2003-01-30 17:18:23.000000000 -0500
@@ -1,12 +1,15 @@SELECT invalid_type_uncaught('rick');
-WARNING:  plpython: in function __plpython_procedure_invalid_type_uncaught_49801:
-plpy.SPIError: Cache lookup for type `test' failed.
+WARNING:  plpython: in function __plpython_procedure_invalid_type_uncaught_154373:
+plpy.SPIError: Unknown error in PLy_spi_prepare.
+ERROR:  Type "test" does not existSELECT invalid_type_caught('rick');
-WARNING:  plpython: in function __plpython_procedure_invalid_type_caught_49802:
-plpy.SPIError: Cache lookup for type `test' failed.
+WARNING:  plpython: in function __plpython_procedure_invalid_type_caught_154374:
+plpy.SPIError: Unknown error in PLy_spi_prepare.
+ERROR:  Type "test" does not existSELECT invalid_type_reraised('rick');
-WARNING:  plpython: in function __plpython_procedure_invalid_type_reraised_49803:
-plpy.SPIError: Cache lookup for type `test' failed.
+WARNING:  plpython: in function __plpython_procedure_invalid_type_reraised_154375:
+plpy.SPIError: Unknown error in PLy_spi_prepare.
+ERROR:  Type "test" does not existSELECT valid_type('rick'); valid_type ------------
@@ -14,20 +17,20 @@(1 row)SELECT read_file('/etc/passwd');
-ERROR:  plpython: Call of function `__plpython_procedure_read_file_49809' failed.
+ERROR:  plpython: Call of function `__plpython_procedure_read_file_154381' failed.exceptions.IOError: can't open files
inrestricted modeSELECT write_file('/tmp/plpython','This is very bad');
 
-ERROR:  plpython: Call of function `__plpython_procedure_write_file_49810' failed.
+ERROR:  plpython: Call of function `__plpython_procedure_write_file_154382' failed.exceptions.IOError: can't open
filesin restricted modeSELECT getpid();
 
-ERROR:  plpython: Call of function `__plpython_procedure_getpid_49811' failed.
-exceptions.AttributeError: getpid
+ERROR:  plpython: Call of function `__plpython_procedure_getpid_154383' failed.
+exceptions.AttributeError: 'module' object has no attribute 'getpid'SELECT uname();
-ERROR:  plpython: Call of function `__plpython_procedure_uname_49812' failed.
-exceptions.AttributeError: uname
+ERROR:  plpython: Call of function `__plpython_procedure_uname_154384' failed.
+exceptions.AttributeError: 'module' object has no attribute 'uname'SELECT sys_exit();
-ERROR:  plpython: Call of function `__plpython_procedure_sys_exit_49813' failed.
-exceptions.AttributeError: exit
+ERROR:  plpython: Call of function `__plpython_procedure_sys_exit_154385' failed.
+exceptions.AttributeError: 'module' object has no attribute 'exit'SELECT sys_argv();    sys_argv    ----------------


--- feature.expected    2002-10-15 11:24:17.000000000 -0400
+++ feature.output    2003-01-30 17:18:23.000000000 -0500
@@ -36,9 +36,10 @@(1 row)SELECT import_succeed();
-     import_succeed     
-------------------------
- succeeded, as expected
+NOTICE:  ('import failed -- No module named _sre',)
+             import_succeed             
+----------------------------------------
+ failed, that wasn't supposed to happen(1 row)SELECT import_test_one('sha hash of this string');
@@ -56,9 +57,9 @@select argument_test_one(users, fname, lname) from users where lname = 'doe' order by 1;
                  argument_test_one
-------------------------------------------------------------------------------------
- jane doe => {'fname': 'jane', 'userid': 1, 'lname': 'doe', 'username': 'j_doe'}
- john doe => {'fname': 'john', 'userid': 2, 'lname': 'doe', 'username': 'johnd'}
- willem doe => {'fname': 'willem', 'userid': 3, 'lname': 'doe', 'username': 'w_doe'}
+ jane doe => {'lname': 'doe', 'username': 'j_doe', 'userid': 1, 'fname': 'jane'}
+ john doe => {'lname': 'doe', 'username': 'johnd', 'userid': 2, 'fname': 'john'}
+ willem doe => {'lname': 'doe', 'username': 'w_doe', 'userid': 3, 'fname': 'willem'}(3 rows)select
nested_call_one('passthis along');
 


pgsql-hackers by date:

Previous
From: Kurt Roeckx
Date:
Subject: Re: [mail] Re: Windows Build System
Next
From: Kevin Brown
Date:
Subject: Re: [mail] Re: Windows Build System