On Mon, Jun 18, 2012 at 11:55 AM, Alek Storm <
alek....@gmail.com> wrote:
> On Sun, Jun 17, 2012 at 12:13 PM, Ben Darnell <
b...@bendarnell.com> wrote:
>>
>> I'd say pypy is officially supported (I'd still be cautious about
>> using pypy in prod, but that caution is directed at pypy in general
>> rather than tornado's support for it).
>>
>> It's not hard to get tornado mostly working on jython if there is
>> enough interest, although I think it would be unlikely to graduate to
>> fully-supported status any time soon. Ironpython has some fundamental
>> problems with its handling of unicode/bytes issues, so I don't think
>> it's suitable for use with tornado without substantial changes on
>> their side.
>
>
> I'm more sympathetic to IronPython's cause; let me see if I can get it
> working with minimal changes in Tornado (Guido officially blessed its
> str==unicode implementation). Could mean a couple more users, who knows?
str==unicode is fine (jython does the same thing, and it's why a lot
of the python 3 changes in tornado are conditioned on "str is unicode"
rather than sys.version[0] == 3). The problem is that on ironpython,
type(u"".encode("utf8")) == unicode, i.e. there's no way that I can
see to distinguish programmatically between an encoded byte string and
a unicode string that happens to contain only latin1 characters.
There is a bytes type, but it's not always used where it should be
(for example, socket.send only accepts type str).
Anyway, if you'd like to take a look at this and see if there's a
solution that I've missed, here are the secrets to get you past the
first few stumbling blocks. Start with a jython-compatible branch and
drop this at the top of runtests.py:
+import sys
+if sys.platform == 'cli':
+ # ironpython's signal module is broken under mono
+ sys.modules['signal'] = object()
+ # doctests needs this
+ sys.__displayhook__ = sys.displayhook
and run with "mono ipy.exe -X:Frames"
>
>> Officially supporting windows would require at least an IOLoop
>> implementation using windows' equivalent of epoll and kqueue.
>
>
> WFM on Windows with Python 2.7 - am I doing something special? Looks like
> Windows does indeed have its own select.select() implementation
> (
http://docs.python.org/library/select.html#select.select); it just doesn't
> accept file objects.
Tornado works on windows now, but doesn't scale very well - the limit
on the number of file descriptors for select() is lower than for unix
(although I think it's become somewhat reasonable in modern versions),
and performance would presumably be better with a windows-specific
implementation. More importantly, this would be a sign that someone
has looked into a windows implementation more deeply than just seeing
that the tests pass and nothing seems obviously broken, which is a key
part of the distinction between "working" and "supported".
-Ben