On Mon, Feb 16, 2009 at 9:34 PM, Chris Van Schaijik
<[email protected]> wrote:
>
> G'day, I've only been playing around with Pylons for a few days
>
> Trying to do something really simple, just run a for loop inside a
> controller action. For the error to occur the loop can be as simple
> as:
> ...
> for i in range(10)
>  print i
> ...
>
> The loop executes, and the numbers 0-9 are printed in the terminal
> output, however as the loop terminates a server error is reported:
> "ValueError: Cannot set attribute to this value" and the line the
> error refers to is the for-loop definition "for i in range(10):"
>
> I'd appreciate your thoughts on the matter.

I don't know if this is related, but you're not supposed to use print
in a Pylons app.  You're supposed to use logging instead.

Sometimes Python's traceback gets confused and points to the wrong
line in the file.  This can happen if you modify the file but Python
doesn't realize it.  Sometimes that means it's reading a stray .pyc
you've forgotten about.

-- 
Mike Orr <[email protected]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to