Why is postorius using python2?

Hi there,
I just downloaded the mailman3 code to see if I can contribute anything. I was astonished to find out that postorius still uses python2 although mailman made the switch to python3. Is there any reason behind this? I asked on the irc channel but got no answer so I'm trying here.
I used 2to3 on the code and successfully executed the code.
I executed the tests, and ran into some errors. If this work is going to be included sometime, I'm willing to investigate and try to fix these errors.
Simon

I thought we still had one upstream dependency that stops us from entirely switching (Florian was keeping better track than I so hopefully he'll chime in), but we'd love to be completely ready to switch when we can even if there's a blocker still, so please feel free to file bugs and make suggestions to improve things!
On August 3, 2015 5:34:26 AM PDT, Simon Hanna <simon.hanna@serve-me.info> wrote:

Hi Simon,
On 08/03/2015 06:04 PM, Simon Hanna wrote:
Not really, its just that we switched the core before 3.0 release and are going to switch postorius too very soon! I infact have a python2/3 compatible branch which runs in python3 without any errors. The reason I haven't sent a pull request is that it is still in bzr on launchpad.
I asked on the irc channel but got no answer so I'm trying here.
I did reply on the list, you probably were gone by then!
Thanks for your interest though!
-- thanks, Abhilash Raj

Simon Hanna writes:
I was astonished to find out that postorius still uses python2 although mailman made the switch to python3.
Why astonished? Lots of applications and libraries are still Python 2-based.
Is there any reason behind this?
It's not always trivial to do a port, and the core developers have other things to do (in particular, two of the core are org admins for GSoC which takes up a lot of time).
Please do. There's no question that your work will be extremely valuable. Submit patches as you write them on the tracker. Make sure (a) something gets fixed (including new test that you write) and (b) there are no regressions in the test suite before posting a pull request.
But if you run into something head-breaking, get in touch with the Postorius developers before spending very much effort on it -- it may be as hard as it looks. :-) (Post here and/or IRC, then try direct email).

Others have provided good answers, but I'll add one comment about what I consider to be policy regarding Python version support. Feedback welcome of course!
On Aug 03, 2015, at 02:34 PM, Simon Hanna wrote:
I was astonished to find out that postorius still uses python2 although mailman made the switch to python3.
The Core can be Python 3-only because the official way to script it is through the REST API, which of course is not only Python-version independent, but actually only depends on you being able to speak HTTP+JSON. Of course mailman.client is the official Python binding to the REST API and that should remain bilingual (Python 2 & 3 compatible) for some time.
Note that this did break HyperKitty at the time because it was importing from the 'mailman' package. That's of course since been fixed.
I think both HyperKitty and Postorius should officially support Python 3, but remain Python 2 compatible. The reason for this is that they're both Django applications, so if they have to co-habitate with other Python 2-only Django apps, they'll need to also run in Python 2. They should be Python 3 compatible, because, well, Python 3 is much awesomer!
Those ports will happen, but I don't know whether they've been milestoned yet.
Cheers, -Barry

Am 2015-08-04 20:55, schrieb Barry Warsaw:
We don't have any direct Python2-only dependencies in Postorius any more since we made the switch from django-social-auth to python-social-auth/django-browserid in April. I'm pretty sure the same is true for HyperKitty (Aurélien...?). So I guess there's no reason why we shouldn't start supporting Python 3 as well.
So the question would be: Go bilingual or py3 only? Bilingual was what we had agreed on before, for the reasons Barry stated above. But mabye this argument becomes less valid as time passes and Python 3 adoption is on the rise. Plus: If someone would want to integrate a py3-only Postorius/HK into an existing site *and* this site is not py3 compatible, it would still be possible to run both on the same server, using another VirtualHost/subdomain or similar.
I'm thinking aloud here, not *necessarily* advocating to only support Python 3 soon. But I wonder if there are really that many people who would be negatively affected by it. And, as stated above, for those who are, there's always a way around it. Mabye it's worth giving it another thought.
OTOH, supporting both py2+3 is probably not that much more work. But it doesn't make our code much nicer and is not exactly a strong satement in favor of Python 3 adoption.
Cheers, Florian

On Aug 04, 2015, at 11:01 PM, f@florianfuchs.com wrote:
I can't really weigh in much because I don't know how typical Django users would want to set up their Mailman site. Would they expect to run all their Django apps in a single instance, and thus a single interpreter version? And if so, would they be blocked from installing and running Postorius and HyperKitty if they were Python 3 only? What do other Django apps typically do?
I *can* say that you'll almost certainly prefer coding in Python 3! Also, that 3.4 makes a very excellent base version to support. And finally, in general it's not that difficult to support both versions, though I don't know how easy it is to support both versions in a Django app. Official bilingual support would have to at least be tested in both versions.
Cheers, -Barry

f@florianfuchs.com writes:
That would be very helpful.
"Less" in terms of numbers. But remember than anybody who really is stuck on Python 2 for some reason is 100% stuck. The argument for bilingual is no less valid than ever for that system. Sure, it's usually possible to run a separate instance, but that would mean that they can't integrate Postorius or HyperKitty with the rest of their site.
It seems to me that punishing folks who have a dependency on Python 2 is hardly a strong statement in favor of Python 3, while providing Python 3 support is the strongest statement in favor of Python 3 that a project can make. Since I'm unlikely to do much, if any, of the work, I have no objection to obsoleting Python 2 support if you think it's too much work. But I hope we can bear some ugliness for a while if that's the main objection to bilingual support.
Regards, Steve

I thought we still had one upstream dependency that stops us from entirely switching (Florian was keeping better track than I so hopefully he'll chime in), but we'd love to be completely ready to switch when we can even if there's a blocker still, so please feel free to file bugs and make suggestions to improve things!
On August 3, 2015 5:34:26 AM PDT, Simon Hanna <simon.hanna@serve-me.info> wrote:

Hi Simon,
On 08/03/2015 06:04 PM, Simon Hanna wrote:
Not really, its just that we switched the core before 3.0 release and are going to switch postorius too very soon! I infact have a python2/3 compatible branch which runs in python3 without any errors. The reason I haven't sent a pull request is that it is still in bzr on launchpad.
I asked on the irc channel but got no answer so I'm trying here.
I did reply on the list, you probably were gone by then!
Thanks for your interest though!
-- thanks, Abhilash Raj

Simon Hanna writes:
I was astonished to find out that postorius still uses python2 although mailman made the switch to python3.
Why astonished? Lots of applications and libraries are still Python 2-based.
Is there any reason behind this?
It's not always trivial to do a port, and the core developers have other things to do (in particular, two of the core are org admins for GSoC which takes up a lot of time).
Please do. There's no question that your work will be extremely valuable. Submit patches as you write them on the tracker. Make sure (a) something gets fixed (including new test that you write) and (b) there are no regressions in the test suite before posting a pull request.
But if you run into something head-breaking, get in touch with the Postorius developers before spending very much effort on it -- it may be as hard as it looks. :-) (Post here and/or IRC, then try direct email).

Others have provided good answers, but I'll add one comment about what I consider to be policy regarding Python version support. Feedback welcome of course!
On Aug 03, 2015, at 02:34 PM, Simon Hanna wrote:
I was astonished to find out that postorius still uses python2 although mailman made the switch to python3.
The Core can be Python 3-only because the official way to script it is through the REST API, which of course is not only Python-version independent, but actually only depends on you being able to speak HTTP+JSON. Of course mailman.client is the official Python binding to the REST API and that should remain bilingual (Python 2 & 3 compatible) for some time.
Note that this did break HyperKitty at the time because it was importing from the 'mailman' package. That's of course since been fixed.
I think both HyperKitty and Postorius should officially support Python 3, but remain Python 2 compatible. The reason for this is that they're both Django applications, so if they have to co-habitate with other Python 2-only Django apps, they'll need to also run in Python 2. They should be Python 3 compatible, because, well, Python 3 is much awesomer!
Those ports will happen, but I don't know whether they've been milestoned yet.
Cheers, -Barry

Am 2015-08-04 20:55, schrieb Barry Warsaw:
We don't have any direct Python2-only dependencies in Postorius any more since we made the switch from django-social-auth to python-social-auth/django-browserid in April. I'm pretty sure the same is true for HyperKitty (Aurélien...?). So I guess there's no reason why we shouldn't start supporting Python 3 as well.
So the question would be: Go bilingual or py3 only? Bilingual was what we had agreed on before, for the reasons Barry stated above. But mabye this argument becomes less valid as time passes and Python 3 adoption is on the rise. Plus: If someone would want to integrate a py3-only Postorius/HK into an existing site *and* this site is not py3 compatible, it would still be possible to run both on the same server, using another VirtualHost/subdomain or similar.
I'm thinking aloud here, not *necessarily* advocating to only support Python 3 soon. But I wonder if there are really that many people who would be negatively affected by it. And, as stated above, for those who are, there's always a way around it. Mabye it's worth giving it another thought.
OTOH, supporting both py2+3 is probably not that much more work. But it doesn't make our code much nicer and is not exactly a strong satement in favor of Python 3 adoption.
Cheers, Florian

On Aug 04, 2015, at 11:01 PM, f@florianfuchs.com wrote:
I can't really weigh in much because I don't know how typical Django users would want to set up their Mailman site. Would they expect to run all their Django apps in a single instance, and thus a single interpreter version? And if so, would they be blocked from installing and running Postorius and HyperKitty if they were Python 3 only? What do other Django apps typically do?
I *can* say that you'll almost certainly prefer coding in Python 3! Also, that 3.4 makes a very excellent base version to support. And finally, in general it's not that difficult to support both versions, though I don't know how easy it is to support both versions in a Django app. Official bilingual support would have to at least be tested in both versions.
Cheers, -Barry

f@florianfuchs.com writes:
That would be very helpful.
"Less" in terms of numbers. But remember than anybody who really is stuck on Python 2 for some reason is 100% stuck. The argument for bilingual is no less valid than ever for that system. Sure, it's usually possible to run a separate instance, but that would mean that they can't integrate Postorius or HyperKitty with the rest of their site.
It seems to me that punishing folks who have a dependency on Python 2 is hardly a strong statement in favor of Python 3, while providing Python 3 support is the strongest statement in favor of Python 3 that a project can make. Since I'm unlikely to do much, if any, of the work, I have no objection to obsoleting Python 2 support if you think it's too much work. But I hope we can bear some ugliness for a while if that's the main objection to bilingual support.
Regards, Steve
participants (6)
-
Abhilash Raj
-
Barry Warsaw
-
f@florianfuchs.com
-
Simon Hanna
-
Stephen J. Turnbull
-
Terri Oda