New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RuntimeError in gunicorn.reloader. #807

Merged
merged 1 commit into from Jun 28, 2014

Conversation

Projects
None yet
2 participants
@berkerpeksag
Collaborator

berkerpeksag commented Jun 28, 2014

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 <listcomp>
    re.sub('py[co]$', 'py', module.__file__)
RuntimeError: dictionary changed size during iteration
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 <listcomp>
    re.sub('py[co]$', 'py', module.__file__)
RuntimeError: dictionary changed size during iteration

benoitc added a commit that referenced this pull request Jun 28, 2014

Merge pull request #807 from berkerpeksag/fix-runtimeerror
Fix RuntimeError in gunicorn.reloader.

@benoitc benoitc merged commit b2d2ff7 into benoitc:master Jun 28, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@berkerpeksag berkerpeksag deleted the berkerpeksag:fix-runtimeerror branch Jun 28, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment