tg2.0.1, line 500 at controllers.py

1 view
Skip to first unread message

Jeffrey

unread,
Jun 26, 2009, 3:51:54 AM6/26/09
to turbo...@googlegroups.com
controllers.py, line 500

    if hasattr(obj, "im_self"):
        klass_instance = obj.im_self
    else:
        print obj
        klass_instance = obj

this will cause apache wsgi exception, is this a bug?


Yours
Faithfully

Jeffrey Hsu

Michael Pedersen

unread,
Jun 26, 2009, 11:48:45 AM6/26/09
to turbo...@googlegroups.com
Inside of WSGI, stderr, stdout, and stdin are all null.As such, there's no way to do a print. At least, not with the default configuration. I think it is possible to change this, and get actual streams you can use, but have never explorer how to do so.

So no, not a bug, not at all. It's working exactly as it's supposed to.
--
Michael J. Pedersen
My IM IDs: Jabber/pede...@icelus.tzo.com, ICQ/103345809, AIM/pedermj022171
         Yahoo/pedermj2002, MSN/pederm...@hotmail.com

Nick Barendt

unread,
Jun 26, 2009, 2:35:00 PM6/26/09
to turbo...@googlegroups.com

  Is that print actually necessary, though, I guess is my question.  I would not really care, but I just updated from a slightly older version and now my nose (nose 0.11) tests are spewing object strings.
  It looks like it was added here:  http://trac.turbogears.org/changeset/6587

-Nick

Jorge Vargas

unread,
Jun 27, 2009, 1:57:56 PM6/27/09
to turbo...@googlegroups.com
On Fri, Jun 26, 2009 at 3:51 AM, Jeffrey<jeff...@gmail.com> wrote:
> controllers.py, line 500
>     if hasattr(obj, "im_self"):
>         klass_instance = obj.im_self
>     else:
>         print obj
>         klass_instance = obj
> this will cause apache wsgi exception, is this a bug?
>
You are right it shouldn't be there. it was left in by mistake while
fixing the security issue we found on RestController (sorry it was
late). Fixed in svn r6592

> Yours
> Faithfully
>
> Jeffrey Hsu
>
> >
>
Reply all
Reply to author
Forward
0 new messages