On Mon, 2009-03-16 at 07:06 -0700, msoulier wrote:
[...]
> The code populating it looks like this
> 
>        metrics.user_licenses_ca = int(
>             details.get('Max_users', '0/0/0').split('/')[2])
> 
> The Max_users field contains a '/' delimited sting of three numbers,
> which is why I'm splitting like that.
> 
> The int() call should enforce an integer.

Since what you're basically saying is that Python's int() function is
broken, I would suggest you verify that that line really is being
executed. Log the value of metrics.user_licenses_ca before you execute
that line. Log it again afterwards. Include the type both times.

I claim that int() is not broken and does indeed return an integer. So
either you've redefined the function int() -- which would be a bad idea
-- or that line isn't being executed or is raising an exception that
you're overlooking (catching it with a bare "except" perhaps).

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to