Comment 10 for bug 94986

Revision history for this message
Christopher Armstrong (radix) wrote :

= GENERAL =

[1] It might be nice to wrap Cursor and Connection objects in something that automatically uses _check_disconnect when being called externally. This would not only allow us to avoid thinking about calling that everywhere we use one of these, but also allow us to avoid accessing a "_" method semi-externally.

[2] It looks like some ' strings got into trunk with the first branch.

[3] The message checking in the postgres code is nasty. As we discovered, psycopg2 has some dumb bugs where it truncates initial text.

     /* try to remove the initial "ERROR: " part from the postgresql error */
     if (err && strlen(err) > 8) err2 = &(err[8]);
     else err2 = err;

This causes all kinds of problems. There's actually another case that has been spotted in the wild but of which I'm not sure of the cause.

<glyph> psycopg2.OperationalError: nection to the server

The truncation that's happening here doesn't match up with the length of "WARNING: " or "ERROR: ".

[5] Can you think of a good place to document DisconnectionError? Maybe we should add it to the docstring of the Connection class, saying that basically any method that talks to the DB might raise it.

= MYSQL =

hmm.. nothing. Looks good! +1!