abourget / gevent-socketio

Official repository for gevent-socketio
http://readthedocs.org/docs/gevent-socketio/en/latest/
BSD 3-Clause "New" or "Revised" License
1.21k stars 330 forks source link

gevent UnicodeError #233

Closed IftachSadeh closed 8 years ago

IftachSadeh commented 8 years ago

Hello,

I'm developing a pyramid app, using gevent 1.1rc3 and gevent-socketio 0.3.6 . I get the following error:

  File "........../python2.7/site-packages/gevent-1.1rc3-py2.7-linux-x86_64.egg/gevent/pywsgi.py", line 748, in start_response
    raise UnicodeError("The value must be a native string", header, value)
UnicodeError: ('The value must be a native string', 'Access-Control-Max-Age', 3600)
<Greenlet at 0x7f23bf614b90: _close_when_done(<socket at 0x7f23be97bd90 fileno=[Errno 9] Bad fil, ('127.0.0.1', 60882))> failed with UnicodeError

This may be resolved by changing the line ("Access-Control-Max-Age", 3600), to ("Access-Control-Max-Age", '3600'), in the two files, ..../site-packages/gevent_socketio-0.3.6-py2.7.egg/socketio/handler.py and ..../site-packages/gevent_socketio-0.3.6-py2.7.egg/socketio/transports.py.

Can this UnicodeError be prevented to begin with? Thank you,

Iftach.

IntegersOfK commented 8 years ago

I am also having this problem, and additionally had to change ('Content-Length', 0) to ('Content-Length', '0') in handler.py

alculquicondor commented 8 years ago

+1 Temporarily solved downgrading to gevent==1.0.2

IftachSadeh commented 6 years ago

Hey again. Will this be fixed in a future version? Testing gevent 1.3.3 (specifically, gevent-1.3.3-py2.7-macosx-10.13-intel.egg), this problem still exists.