Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8207c6b

Browse files
committed
Fix freshly-introduced PL/Python portability bug.
It turns out that those PyErr_Clear() calls I removed from plpy_elog.cin7e3bb08 et al were not quite as random as they appeared: theymask a Python 2.3.x bug. (Specifically, it turns out that PyType_Ready()can fail if the error indicator is set on entry, and PLy_traceback's fetchof frame.f_code may be the first operation in a session that requires the"frame" type to be readied. Ick.) Put back the clear call, but in a morecentralized place closer to what it's protecting, and this time with acomment warning what it's really for.Per buildfarm member prairiedog. Although prairiedog was only failingon HEAD, it seems clearly possible for this to occur in older branchesas well, so back-patch to 9.2 the same as the previous patch.
1 parentec91ee8 commit8207c6b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

‎src/pl/plpython/plpy_elog.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ PLy_traceback(PyObject *e, PyObject *v, PyObject *tb,
226226

227227
PG_TRY();
228228
{
229+
/*
230+
* Ancient versions of Python (circa 2.3) contain a bug whereby
231+
* the fetches below can fail if the error indicator is set.
232+
*/
233+
PyErr_Clear();
234+
229235
lineno=PyObject_GetAttrString(tb,"tb_lineno");
230236
if (lineno==NULL)
231237
elog(ERROR,"could not get line number from Python traceback");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp