Technical mailing list archives

Re: On an error...

Leonardo Pistone
- 07/31/2015 04:34:30
Hi Manuel,

I don't know myself, but for this kind of low-level bugs in the
framework, you can try too create an issue on odoo/odoo and kindly
ping Raphaël Collet @rco-odoo (he is the main author of the new new

On Fri, Jul 31, 2015 at 12:18 AM, Manuel Vázquez <> wrote:
> Hi all,
> >From time to time (probably once every two days or less), I'm having an
> error.  Complaining about iterating over list that changed.
> This is the last portion of the traceback (it can happen with any model,
> so that top part always changes)::
>   File "openerp/", line 239, in wrapper
>     return new_api(self, *args, **kwargs)
>   File "openerp/", line 3185, in read
>     values[name] = field.convert_to_read(record[name], use_name_get)
>   File "openerp/", line 1552, in convert_to_read
>     value_sudo = value.sudo()
>   File "openerp/", line 5281, in sudo
>     return self.with_env(self.env(user=user))
>   File "openerp/", line 737, in __call__
>     return Environment(cr, uid, context)
>   File "openerp/", line 707, in __new__
>     for env in envs:
>   File "python2.7/", line 60, in __iter__
>     for itemref in
> RuntimeError: Set changed size during iteration
> I noticed the `envs` holds a local `Environments()` instance.  The
> `__iter__` of it, returns an iterator over a `WeakSet`.
> I think this is due to gc collecting some of the environments while the
> loop is still going on...
> Any ideas?
> Manuel.