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
Graham Dumpleton made changes - 02/Oct/06 04:56 AM
Field Original Value New Value
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.3 [ 12310101 ]
Graham Dumpleton made changes - 01/May/07 10:47 AM
Status Resolved [ 5 ] Closed [ 6 ]