-
Notifications
You must be signed in to change notification settings - Fork 22
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
Redefinition of ThreadingHTTPServer in server.py and server-r.py #35
Comments
That's a class override to inject Thanks @BuongiornoTexas . |
I'm not seeing any odd behaviour. But isn't line 110 re-declaring rather than over-riding ThreadingHTTPServer? That is, this creates a new class type inheriting from HTTPServer and ThreadingMixIn (i.e. discarding the imported definition and replacing it with the new class). That's certainly the warning I'm getting from mypy. Your declaration should give the same result as the import - I checked the library module, and the definition of the imported ThreadingHTTPServer is the same as your redeclaration.
So not an issue now, just an oddity. |
I just did what I should of have done in the first place and tested commenting out lines 110-112. From a quick and dirty check, it looks as though the server operates as expected - in particular threads fire up and don't block. Given I've gone a PR for ToU that includes minor changes to server.py, are you happy for me to roll this into that PR? |
Yes, please do! |
Hi @jasonacox,
I'm not quite sure what is happening here, but the code in the server modules is doing something odd. Using server.py as the example:
From a quick object inspection, line 347 creates server with base classes of HTTPServer and ThreadingMixIn (from line 110) - which is not helpful, because these are the base classes we would expect from the redefinition and also the base classes for ThreadingHTTPServer ...
Is this what you intended or should lines 110-112 be removed and line be modified to:
I'm guessing the latter?
(This is an aside triggered by the ToU stuff I'm putting together - which unfortunately could be made thread unsafe very easily!).
The text was updated successfully, but these errors were encountered: