benoitc/gunicorn — pull request #807 by berkerpeksag (2014-06-28 04:03:48+00:00)
Title: Fix RuntimeError in gunicorn.reloader.

Here's the reproducer in Python 3.3:

$ gunicorn --paste paste.ini --reload

Then I got the following exception:

Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python3.3/threading.py", line 901, in _bootstrap_inner
self.run()
File "/home/berker/hacking/mediagoblin/venv3/lib/python3.3/site-packages/gunicorn/reloader.py", line 41, in run
for filename in self.get_files():
File "/home/berker/hacking/mediagoblin/venv3/lib/python3.3/site-packages/gunicorn/reloader.py", line 29, in get_files
for module in sys.modules.values()
File "/home/berker/hacking/mediagoblin/venv3/lib/python3.3/site-packages/gunicorn/reloader.py", line 28, in
re.sub('py[co]$', 'py', module.__file__)
RuntimeError: dictionary changed size during iteration