seanjensengrey / cogen

Automatically exported from code.google.com/p/cogen
MIT License
0 stars 0 forks source link

Unicode on Windows #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Here's a script:

from cogen.web import wsgi

def application(environ, start_response):
    start_response('200 OK', [('Content-type','text/plain')])
    return u'fud'

try:
    wsgi.server_factory({}, '0.0.0.0', 8080)(application)
except (KeyboardInterrupt, SystemExit):
    pass

Note the unicode string -- on Windows (running Python 2.5.2), am getting
when I hit the server:

Traceback (most recent call last):
  File "cogen_wsgi", line 9, in <module>
    wsgi.server_factory({}, '0.0.0.0', 8080)(application)
  File "build\bdist.win32\egg\cogen\web\wsgi.py", line 793, in serve
  File "build\bdist.win32\egg\cogen\core\schedulers.py", line 230, in run
  File "build\bdist.win32\egg\cogen\core\schedulers.py", line 212, in iter_run
  File "build\bdist.win32\egg\cogen\core\proactors\iocp_impl.py", line 247,
in run
  File "build\bdist.win32\egg\cogen\core\proactors\iocp_impl.py", line 175,
in process_op
  File "build\bdist.win32\egg\cogen\core\proactors\iocp_impl.py", line 130,
in request_generic
  File "build\bdist.win32\egg\cogen\core\proactors\base.py", line 196, in
add_token
AssertionError

This may be unrelated, but I'm also seeing the following when I start the
script:

C:\Lib\Python25\lib\site-packages\cogen-0.2.0-py2.5.egg\cogen\core\proactors\ioc
p_impl.py:103:
UserW
arning: Unsupported option multiplex_first for <IOCPProactor [{}]>
  self._warn_bogus_options(**bogus_options) #iocp doesn't have any options

Original issue reported on code.google.com by g%rre.tt@gtempaccount.com on 26 Nov 2008 at 1:52

GoogleCodeExporter commented 8 years ago
Fixed in trunk - will work for most cases, will probably fail with an encoding
failure when passing unicode strings that have special chars. You should never 
pass
unicodes, always encode them to something before.

Original comment by ionel...@gmail.com on 26 Nov 2008 at 7:11