Apache Mod-Python - Closed: (MODPYTHON-189) repr() for various objects doesn't

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > May 2007 > Closed: (MODPYTHON-189) repr() for various objects doesn't





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Closed: (MODPYTHON-189) repr() for various objects doesn't
Graham Dumpleton (JIRA)

2007-05-01, 7:12 am


[ https://issues.apache.org/jira/brow...ls:all-tabpanel ]

Graham Dumpleton closed MODPYTHON-189.
--------------------------------------


> repr() for various objects doesn't convert data members correctly.
> ------------------------------------------------------------------
>
> Key: MODPYTHON-189
> URL: https://issues.apache.org/jira/browse/MODPYTHON-189
> Project: mod_python
> Issue Type: Bug
> Components: core
> Affects Versions: 3.3, 3.2.10
> Reporter: Graham Dumpleton
> Priority: Minor
> Fix For: 3.3
>
>
> 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.


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com