Title: socket Level 6 not supported
Type: Severity: normal
Components: Library Versions: 2.5b1
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: amak Nosy List: Christof, amak
Priority: Keywords:

Created on 2009-05-13.11:06:12 by Christof, last changed 2009-05-18.19:18:25 by Christof.

msg4681 (view) Author: Christof (Christof) Date: 2009-05-13.11:06:11
(I try to run with Jython 2.5rc2 but have 2 problems (the other
with transformer put as another issue).

I use the basic example on (folder web with the source
is in on the path). During server startup I get the following output:
Traceback (most recent call last):
  File "", line 22, in <module>
  File "I:\dev-a-workspace\dev\jywebpy\web\", line 289, in run
    return wsgi.runwsgi(self.wsgifunc(*middleware))
  File "I:\dev-a-workspace\dev\jywebpy\web\", line 54, in runwsgi
    return httpserver.runsimple(func, validip(listget(sys.argv, 1, '')))
  File "I:\dev-a-workspace\dev\jywebpy\web\", line 223, in
  File "I:\dev-a-workspace\dev\jywebpy\web\", line 223, in
  File "I:\dev-a-workspace\dev\jywebpy\web\wsgiserver\", line
1589, i
n start
  File "<string>", line 1, in listen
  File "I:\dev-a-workspace\dev\jywebpy\", line 788, in listen
  File "I:\dev-a-workspace\dev\jywebpy\", line 788, in listen
  File "I:\dev-a-workspace\dev\jywebpy\", line 727, in _config
    self.sock_impl.setsockopt(level, optname, self.pending_options[
(level, optn
ame) ])
  File "I:\dev-a-workspace\dev\jywebpy\", line 248, in setsockopt
    raise error(errno.ENOPROTOOPT, "Level %d option not supported on
 %d" % (level, str(self.jsocket), option))
socket.error: (43, 'Level 6 option not supported on
0.0.0,localport=8080]): 256')

I have no real idea what is going on in socket module but after adding
"if level == 6: continue" in line 721 (so simple removing this level) at
least the server does seem to start properly.

Please excuse my naivity, hope this is not complete bullshit...
msg4686 (view) Author: Alan Kennedy (amak) Date: 2009-05-15.16:52:17
Are you using a version of that you have modified yourself?

I notice from your traceback that you have a local copy of in

The self._config() call in the _listen() method is on line 783 in the
version of released with RC2, whereas your traceback gives it
as being on line 788?

If you have modified your local copy of, it will not be
possible for me to determine why this is happening.

Although I guess that you have added some socket options to your local
copy of (I must improve that error message).

If you have a local copy of, please attach it to this bug
report so that I can get a look at it.
msg4689 (view) Author: Christof (Christof) Date: 2009-05-15.17:02:02
I have used the from Jython 2.5rc2's Lib/site-packages
directory and copied it to my local path as I did not wanted to change
to lib. I only added the additional line "if level == 6: continue" to
test if I could get any further with my attempt to run Hope that
msg4691 (view) Author: Alan Kennedy (amak) Date: 2009-05-17.20:49:12
This error is happening because webpy is trying to set the socket option
TCP_NODELAY on a server socket, which is not supported on java, and thus

I have checked in a change to error reporting for this situation, so
that the error message gives the names of the option constants involved
in the error, rather than the symbolic constants, which were obviously

The change was made at revision 6354. You can download the updated
version from

Looking at the webpy code, I see that the option is set on line 1610 of
file "web/wsgiserver/" of the current release. This is only
done if the "nodelay" option is set true. So if you set that option to
False, then the TCP_NODELAY option is not set, thus preventing this problem.

You may want to report this as a bug to the webpy folks, since
unsupported socket options on jython give an exception.
msg4696 (view) Author: Christof (Christof) Date: 2009-05-18.19:18:24
great, thanks a lot!
Date User Action Args
2009-05-18 19:18:25Christofsetmessages: + msg4696
2009-05-17 20:49:13amaksetstatus: open -> closed
resolution: fixed
messages: + msg4691
2009-05-15 17:02:02Christofsetmessages: + msg4689
2009-05-15 16:52:18amaksetassignee: amak
messages: + msg4686
nosy: + amak
2009-05-13 11:06:12Christofcreate