<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 05/20/2014 05:40 AM, Maxim Lacrima
wrote:<br>
</div>
<blockquote
cite="mid:CAKef57PD5my4d6ajCEJtz+Ud9KvFCxyw8EH=Qpz9ed5X7D+MtQ@mail.gmail.com"
type="cite">
<div dir="ltr">Hello!
<div><br>
</div>
<div>I can see that Python 3 support in Twisted is incomplete. I
was able to `pip install twisted` on Python 3, but I couldn't
run a simple example program using Twisted Agent.</div>
<div><br>
</div>
<div style="">A simple `from twisted.web.client import Agent`
causes `ImportError: No module named 'twisted.python.systemd'`</div>
<div style=""><br>
</div>
<div style="">I would like to help in porting Twisted to Python
3. I have a couple of questions.<br>
</div>
<div style=""><br>
</div>
<div style="">My initial idea was to run some twisted tests with
trial and start from there. But it looks like trial is not
ported to python3 and also I think many tests themselves are
not python3 aware.</div>
</div>
</blockquote>
<br>
The trial command-line tool is not ported, but the library part is.<br>
<br>
<a class="source"
href="https://twistedmatrix.com/trac/browser/trunk/admin/run-python3-tests">admin/run-python3-tests</a>
will run Twisted's tests on Python 3.<br>
<br>
<blockquote
cite="mid:CAKef57PD5my4d6ajCEJtz+Ud9KvFCxyw8EH=Qpz9ed5X7D+MtQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div style="">So what is a recommended workflow?</div>
<div style=""><br>
</div>
</div>
</blockquote>
<br>
See <a class="moz-txt-link-freetext" href="https://twistedmatrix.com/trac/wiki/Plan/Python3">https://twistedmatrix.com/trac/wiki/Plan/Python3</a><br>
<br>
<blockquote
cite="mid:CAKef57PD5my4d6ajCEJtz+Ud9KvFCxyw8EH=Qpz9ed5X7D+MtQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div style="">As for Twisted Agent... URL and its parsed
components are now bytes, but `Agent._getEndpoint` operates on
str, and so do other functions (`isIPAddress`,
`isIPv6Address`), causing type and other errors.</div>
</div>
</blockquote>
<br>
Probably Agent would probably need to be modified to explicitly take
bytes on both Python 2 and Python 3, since URLs are bytes.<br>
<br>
<br>
</body>
</html>