Issue Details (XML | Word | Printable)

Key: MODPYTHON-189
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Graham Dumpleton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
mod_python

repr() for various objects doesn't convert data members correctly.

Created: 11/Sep/06 10:42 AM   Updated: 01/May/07 10:47 AM
Return to search
Component/s: core
Affects Version/s: 3.3.x, 3.2.10
Fix Version/s: 3.3.1

Time Tracking:
Not Specified

Resolution Date: 02/Oct/06 04:56 AM


 Description  « Hide
The repr() methods of various objects, eg., tableobject, use code like:

            PyString_ConcatAndDel(&s, PyString_FromString("'"));
            PyString_ConcatAndDel(&s, PyString_FromString(elts[i].key));
            PyString_ConcatAndDel(&s, PyString_FromString("': '"));
            PyString_ConcatAndDel(&s, PyString_FromString(elts[i].val));
            PyString_ConcatAndDel(&s, PyString_FromString("'"));

to construct the string. This doesn't though consider that values could have quotes in them.

Instead of outputting quotes and string in between, should use something like:

               t = PyString_FromString(elts[i].val);
               PyString_ConcatAndDel(&s, PyObject_Repr(t));
               Py_XDECREF(t);

Ie., let the repr() routine of the string to quote as appropriate.

Since the repr() outputs of these objects are only used for debugging and can't be used to reconstruct objects, not too big a deal, but should be addressed.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #451881 Mon Oct 02 04:56:19 UTC 2006 grahamd (MODPYTHON-189) Fixed representation returned by calling repr() on a table
object. Note this was committed as part of change for MODPYTHON-187.
Files Changed
MODIFY /httpd/mod_python/trunk/Doc/appendixc.tex