You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by "Graham Dumpleton (JIRA)" <ji...@apache.org> on 2006/09/11 12:43:22 UTC

[jira] Created: (MODPYTHON-189) repr() for various objects doesn't convert data members correctly.

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

                 Key: MODPYTHON-189
                 URL: http://issues.apache.org/jira/browse/MODPYTHON-189
             Project: mod_python
          Issue Type: Bug
          Components: core
    Affects Versions: 3.2.10, 3.3
            Reporter: Graham Dumpleton
            Priority: Minor


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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (MODPYTHON-189) repr() for various objects doesn't convert data members correctly.

Posted by "Graham Dumpleton (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/MODPYTHON-189?page=all ]

Graham Dumpleton resolved MODPYTHON-189.
----------------------------------------

    Fix Version/s: 3.3
       Resolution: Fixed

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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MODPYTHON-189) repr() for various objects doesn't convert data members correctly.

Posted by "Graham Dumpleton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MODPYTHON-189?page=com.atlassian.jira.plugin.system.issuetabpanels: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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.