Skip to content
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

klein can not listen on unix sockets #17

Closed
FugiTech opened this issue Jun 11, 2013 · 3 comments
Closed

klein can not listen on unix sockets #17

FugiTech opened this issue Jun 11, 2013 · 3 comments

Comments

@FugiTech
Copy link

Example script (broken.py)

from klein import route, resource

@route("/")
def index(request):
    return "It works!"

Run with twistd web -p unix:web.sock --class=broken.resource, the following exception occurs.

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/twisted/protocols/basic.py", line 581, in dataReceived
    why = self.lineReceived(line)
  File "/usr/local/lib/python2.7/dist-packages/twisted/web/http.py", line 1611, in lineReceived
    self.allContentReceived()
  File "/usr/local/lib/python2.7/dist-packages/twisted/web/http.py", line 1686, in allContentReceived
    req.requestReceived(command, path, version)
  File "/usr/local/lib/python2.7/dist-packages/twisted/web/http.py", line 790, in requestReceived
    self.process()
--- <exception caught here> ---
  File "/usr/local/lib/python2.7/dist-packages/twisted/web/server.py", line 192, in process
    self.render(resrc)
  File "/usr/local/lib/python2.7/dist-packages/twisted/web/server.py", line 241, in render
    body = resrc.render(self)
  File "/usr/local/lib/python2.7/dist-packages/klein/resource.py", line 29, in render
    server_port = request.getHost().port
exceptions.AttributeError: 'UNIXAddress' object has no attribute 'port'
@MostAwesomeDude
Copy link
Contributor

Filed against Twisted already.
On Jun 10, 2013 7:14 PM, "Fugiman" notifications@github.com wrote:

Example script (broken.py)

from klein import route, resource

@route("/")
def index(request):
return "It works!"

Run with twistd web -p unix:web.sock --class=broken.resource, the
following exception occurs.

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/twisted/protocols/basic.py", line 581, in dataReceived
why = self.lineReceived(line)
File "/usr/local/lib/python2.7/dist-packages/twisted/web/http.py", line 1611, in lineReceived
self.allContentReceived()
File "/usr/local/lib/python2.7/dist-packages/twisted/web/http.py", line 1686, in allContentReceived
req.requestReceived(command, path, version)
File "/usr/local/lib/python2.7/dist-packages/twisted/web/http.py", line 790, in requestReceived
self.process()
--- ---
File "/usr/local/lib/python2.7/dist-packages/twisted/web/server.py", line 192, in process
self.render(resrc)
File "/usr/local/lib/python2.7/dist-packages/twisted/web/server.py", line 241, in render
body = resrc.render(self)
File "/usr/local/lib/python2.7/dist-packages/klein/resource.py", line 29, in render
server_port = request.getHost().port
exceptions.AttributeError: 'UNIXAddress' object has no attribute 'port'


Reply to this email directly or view it on GitHubhttps://github.com//issues/17
.

@dreid
Copy link
Contributor

dreid commented Jun 26, 2013

This is something that should be fixed in twisted, not klein.

@dreid dreid closed this as completed Jun 26, 2013
@InfoSec812
Copy link
Contributor

Please re-open... I am submitting a PR to resolve this inside of Klein as it is Klein which is doing something which is incompatible with AF_UNIX sockets and not Twisted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants