On Thu, Jun 18, 2026 at 6:08 PM Maël <[email protected]> wrote:
>
> Hello,
>
> We encountered a runtime issue with the tracoverlayview plugin when running 
> under Python 2.7.
>
> The error is caused by iterating over a dictionary while it may be modified 
> during the loop. In our case, the issue occurs in tracoverlayview/web_ui.py, 
> in the _get_mimetypes() method:
> for ext, mimetype in _iteritems(map_):
>
> This can raise the following error:
> RuntimeError: dictionary changed size during iteration
>
> We applied the following local patch to iterate over a static list of items 
> instead:
> for ext, mimetype in list(_iteritems(map_)):
>
> Suggested patch:
> -            for ext, mimetype in _iteritems(map_):
> +           for ext, mimetype in list(_iteritems(map_)):
>
> This fixes the issue in our environment.
> Thank you.

Thanks for the reporting. But unable to reproduce the issue. Also,
very weird. The "map_" is not modified after initialized by Trac core
and mimetypes module. I don't believe the error is raised.

-- 
Jun Omae <[email protected]> (大前 潤)

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/trac-users/CAEVLMahymUhWNE2XccBOxbgqyzVTgOY%2Ba9U-RDh6RJ3uhDFiaQ%40mail.gmail.com.

Reply via email to