-
Notifications
You must be signed in to change notification settings - Fork 119
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
Producer not being unregistered when wrapping static.File #28
Comments
It seems to be a Twisted 13.2 thing, not sure how I didn't catch it in my testing, since I use Klein pretty heavily... |
@hawkowl Is there anything klein can do to work around it? Do you have a reference to a ticket for it? |
I'm not actually sure what's causing it yet - I do know that it's only happened for me in Twisted 13.2, though. I'll try to figure out what's changed in File between 13.1 and 13.2, and make up a patch if it's something I can fix. |
Nope, this isn't a Twisted bug, this is a Klein bug. Works in 0.2.0 and 0.2.1, but not in 0.2.2. looks for why |
PR above fixes this for me. |
It fixes it, but it's actually wrong - from discussion on IRC with @dreid , it looks like some rejiggering of the callback chain could fix this. I'll try and get a look in today. |
I guess I should mention here that PR30 is "done", and is awaiting someone to take a look. |
This is merged! Should work fine now. |
Indeed it does! Thanks much. |
You're welcome! Sorry it took so long, but it's in there now! :) |
FWIW this fix works for me too on 13.2 + ubuntu 12.04. Thanks heaps! |
Hi, this is now on the version on pypi! |
(Using Klein master and Twisted 13.2.0)
Hi, just started using Klein for a small project, and I noticed that whenever I return static.File from a route-decorated function or method, I will intermittently see "Producer was not unregistered" when accessing files in the directory being served by static.File.
Plain old twisted.web works, this error only shows up when using Klein.
Simple example, run with "twistd --nodaemon web --class=testing.resource":
testing.py
And lastly, the traceback from the logfile:
2013-11-13 10:47:26-0600 [HTTPChannel,0,127.0.0.1] 127.0.0.1 - - [13/Nov/2013:16:47:25 +0000] "GET /files/robots.txt HTTP/1.1" 200 27 "http://127.0.0.1:8080/files/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.71 (KHTML, like Gecko) Version/6.1 Safari/537.71"
2013-11-13 10:47:26-0600 [HTTPChannel,0,127.0.0.1] Unhandled Error
Traceback (most recent call last):
Failure: exceptions.RuntimeError: Producer was not unregistered for /files/robots.txt
The text was updated successfully, but these errors were encountered: