Better Error message for missing symbols

11 views
Skip to first unread message

Sarvi Shanmugham

unread,
Sep 21, 2012, 7:10:19 PM9/21/12
to pytho...@googlegroups.com
Today when loading the library I simply get "cannot load library libxyz.so"

printable_filename = filename_or_null ? filename_or_null : "<None>";
    handle = dlopen(filename_or_null,
                    RTLD_LAZY | (is_global?RTLD_GLOBAL:RTLD_LOCAL));
    if (handle == NULL) {
        PyErr_Format(PyExc_OSError, "cannot load library: %s",
                     printable_filename);
        return NULL;
    }

Instead the following might provide more information for debugging that also tells us what symbols were missing.
PyErr_Format(PyExc_OSError, "cannot load library: %s", dlerror());

Thx,
Sarvi

Armin Rigo

unread,
Sep 22, 2012, 4:43:20 AM9/22/12
to pytho...@googlegroups.com
Hi Sarvi,

On Sat, Sep 22, 2012 at 1:10 AM, Sarvi Shanmugham <sarv...@gmail.com> wrote:
> PyErr_Format(PyExc_OSError, "cannot load library: %s", dlerror());

Indeed, thanks! Checked in in 6d2a272ad747.


Armin
Reply all
Reply to author
Forward
0 new messages