The reason for the change was to avoid records populated with the zero
option ('').
I think I fixed the problem, please check it.

On Aug 17, 1:44 pm, Marin Pranjić <marin.pran...@gmail.com> wrote:
> Hi,
>
> i have a code that works on latest stable, but raises an exception in
> trunk version.
>
>   File "/srv/web2py/gluon/contrib/populate.py", line 97, in populate
>     record[fieldname] = options[random.randint(0,len(options)-1)][0]
>   File "/usr/lib/python2.7/random.py", line 241, in randint
>     return self.randrange(a, b+1)
>   File "/usr/lib/python2.7/random.py", line 217, in randrange
>     raise ValueError, "empty range for randrange() (%d,%d, %d)" %
> (istart, istop, width)
> ValueError: empty range for randrange() (0,0, 0)
>
> I'm still trying to reproduce this and find what causes this
> exception. It must be something related to latest changes because it
> works in stable.
> Line 96 has changed so someone must know why and where is the bug :-)
> 96: options=field.requires.options(zero=False)
>
> Something related to Field(... requires=... ) ?
> I will reply when I reproduce on minimalist test app.
>
> Marin

Reply via email to