New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3 #38

Closed
denik opened this Issue Sep 13, 2012 · 98 comments

Comments

Projects
None yet
@denik
Member

denik commented Sep 13, 2012

Would be cool to have python3 support, ideally as single source.

Here's an old python3 fork: http://bitbucket.org/jjonte/gevent

Reported by Denis.Bilenko.


earlier comments

Denis.Bilenko said, at 2011-01-28T05:36:07.000Z:

There's some work going on at https://bitbucket.org/Edmund_Ogban/gevent-py3k

carsten.klein@axn-software.de said, at 2011-03-20T18:40:50.000Z:

Exception handling is a problem here. With Python2.5 there is only except Exception, e, whereas Python3.x requires except Exception as e.

Making this single source supporting 2.5 and higher is therefore quite difficult. Or is there some future that can be used to simulate the new syntax included with the language since 2.6?

Otherwise I would say: drop support for Python 2.5 with the next release version, and make that one compatible with 2.6 .. 3.2.

anacrolix said, at 2011-09-13T00:03:14.000Z:

I'm keen to try gevent, but I sailed for Python3 over a year ago.

anacrolix said, at 2011-09-20T00:23:26.000Z:

Denis can you report on the status of Python3 support for gevent?

Denis.Bilenko said, at 2011-12-20T18:14:35.000Z:

Issue 89 has been merged into this issue.

luchenue said, at 2011-12-23T09:14:52.000Z:

Any news ?

anacrolix said, at 2011-12-23T11:09:10.000Z:

From what I've observed, I don't think Denis wants to break support for Python 2 yet, and so won't accept patches that don't support both 2 *and* 3, which is a complex obstacle.

k.cherkasoff said, at 2011-12-23T11:42:53.000Z:

Is there any up to date forks for python 3.x ?

whitelynx said, at 2012-02-01T07:13:18.000Z:

I think the general approach for maintaining anything that's supposed to work on 2.5 - 3.x is to use the 2to3 tool to automatically generate a python3 version from the python2 source. The exception handling issue mentioned by carsten above (comment 2) is treated by the 'except' fixer in 2to3. (http://docs.python.org/library/2to3.html?highlight=except#2to3fixer-except) Since fixers can be run individually, it shouldn't be too difficult to put together a 2to3 command line that would be able to translate gevent with a minimum amount of breakage, and then just manually clean up the results. I do wish there was a 3to2 or similar that would translate some of the python3-style idioms to something compatible with 2.5, as with the 'except _ as _' syntax.

amcnabb8 said, at 2012-02-09T19:14:00.000Z:

The six library makes it very easy to support both Python 2 (>=2.6) and Python 3 without needing 2to3. With a couple of workarounds, Michael Foord has shown that it's entirely possible to support Python 2.4 without 2to3. But really, it's not as hard as it sounds to support both Python 2 and 3, and there are two reasonable approaches.

@shakefu

This comment has been minimized.

shakefu commented Oct 1, 2012

Just want to add a +1 to this, though I'm not sure if I can contribute. With the latest Python 3.3 release, lack of gevent is the only thing holding me back from making the jump.

@Ivoz

This comment has been minimized.

Contributor

Ivoz commented Oct 24, 2012

Would you be willing to drop 2.5 for 3.3?

@denik

This comment has been minimized.

Member

denik commented Oct 24, 2012

I think so. unlikely for 1.0 (there's just no time), but for some release after that, yes.

@jakewan

This comment has been minimized.

jakewan commented Oct 24, 2012

I'm really glad this is on the radar. I'm sort of in the same boat as anacrolix above. I use Python 3 by default nowadays, and would love to be able to use it with gevent.

@ghost

This comment has been minimized.

ghost commented Oct 29, 2012

I really really would like to see gevent support Python 3 as soon as possible.. It's one of those vital python libraries that if starts supporting 3.x, lot's of python crowd will be making the switch.

@niwinz

This comment has been minimized.

niwinz commented Oct 29, 2012

+1

I'm migrating my development to python3 and really, I would have gevent with python3.

@denik

This comment has been minimized.

Member

denik commented Oct 29, 2012

+1s will not speed it up (we already know lots of people want it).

To help, contribute. Create a branch, enable python 3.3/3.2 in travis and start making test suite work.

  • it's ok to break 2.5 compat in the process - we can deal with it afterwards (or drop support for it)
  • it's ok to only support latest python3k (3.3) and ignore 3.2.
  • definitely ignore 3.1 and 3.0

fantix added a commit to fantix/gevent that referenced this issue Nov 30, 2012

fantix added a commit to fantix/gevent that referenced this issue Nov 30, 2012

fantix added a commit to fantix/gevent that referenced this issue Nov 30, 2012

fantix added a commit to fantix/gevent that referenced this issue Dec 5, 2012

fantix added a commit to fantix/gevent that referenced this issue Dec 6, 2012

fantix added a commit to fantix/gevent that referenced this issue Dec 7, 2012

fantix added a commit to fantix/gevent that referenced this issue Dec 7, 2012

fantix added a commit to fantix/gevent that referenced this issue Dec 7, 2012

fantix added a commit to fantix/gevent that referenced this issue Dec 10, 2012

Refs gevent#38, sync fixes with master 1.0rc2. Command:
 * git merge issue38_2 --squash --no-commit

Conflicts:
	gevent/subprocess.py

fantix added a commit to fantix/gevent that referenced this issue Dec 10, 2012

fantix added a commit to fantix/gevent that referenced this issue Dec 10, 2012

fantix added a commit to fantix/gevent that referenced this issue Dec 10, 2012

Fixed gevent#38, Gevent now supports Python 3.3 as single source.
The tests are all passing now. But some of the Python 3 stdlib
interfaces are not implemented yet. And, there are still lots of
ResourceWarnings for unclosed files or sockets in Python 3.

These modules are fixed with explict PY3 code fragment branches:

    ares, backdoor, core, fileobject, hub, os, pywsgi, queue,
    server, socket, ssl, subprocess

The Six library is partly introduced as a part of hub.py (while
for tests it is greentest/six.py). These symbols are added:

    text_type, binary_type, xrange, b, u, reraise

Travis can test under Python 3.3 for now, and ignoring tests
depending on web.py which doesn't support Python 3 yet.

@Zearin Zearin referenced this issue Jan 6, 2013

Open

Py3 status (site, README) #23

0 of 2 tasks complete
@Elizafox

This comment has been minimized.

Elizafox commented Jan 7, 2013

@fantix why not leave a pull request? :)

@fantix

This comment has been minimized.

Contributor

fantix commented Jan 7, 2013

@ElizaCat :D I'm kind of waiting for the authors to reply in the mailing list - it's probably going to be done after 1.0 is released I suppose.

@Ivoz

This comment has been minimized.

Contributor

Ivoz commented Feb 9, 2013

Good attempt fantix! It seems sockets are going to be a major issue getting right, and I would guess a good knowledge of python internals is needed to get them working properly again.

@Ivoz

This comment has been minimized.

Contributor

Ivoz commented Feb 18, 2013

@denik Do you know much about how to get sockets working with the new python? Was it a pain originally with python 2? Know of any good reading for learning how to emulate the internal API successfully, etc?

@Elizafox

This comment has been minimized.

Elizafox commented Feb 24, 2013

I've been using fantix's branch for some time, and it works great for me. I think it needs some merges though.

Python sockets in python 3 are now based on the io module, @Ivoz, which is different from Python 2. I'll have a deeper look at the ResourceWarnings later.

@westurner

This comment has been minimized.

westurner commented Apr 8, 2013

@fantix
Thanks!

@westurner

This comment has been minimized.

westurner commented Apr 8, 2013

@Ivoz

It seems sockets are going to be a major issue getting right, and I would guess a good knowledge of python internals is needed to get them working properly again.

Why do you ask?

Here are some resources for doing socket programming in Python 3:

@westurner

This comment has been minimized.

westurner commented Apr 8, 2013

@koliyo

This comment has been minimized.

koliyo commented May 19, 2015

+1

@thedrow

This comment has been minimized.

Contributor

thedrow commented Jun 18, 2015

Hi guys @fantix has contributed a lot of Pull Requests.
Some are not merged and some are only partially merged.
Can we please have someone look at those?

@macolo

This comment has been minimized.

macolo commented Jun 20, 2015

Yes, please, what's going on?

@jamadden

This comment has been minimized.

Member

jamadden commented Jun 20, 2015

I've just merged (updates of) many of the open Python 3 PRs or variations on them, including #412, #413, #416, #421, #462, #474, and #409. The Py3 build is green now with only one known failing test (test__socket_dns.py).

@fantix

This comment has been minimized.

Contributor

fantix commented Jun 21, 2015

@jamadden Awesome! Much appreciated for the hard work! 🚀

@mjumbewu

This comment has been minimized.

mjumbewu commented Jun 21, 2015

@jmadden @fantix you guys are amazing.

@thedrow

This comment has been minimized.

Contributor

thedrow commented Jun 21, 2015

Wonderful.
Now let's fix that test and the failing tests in #248 and we can release 1.1.

@thedrow

This comment has been minimized.

Contributor

thedrow commented Jun 21, 2015

@jamadden It seems that the DNS test should be fixed in #418 but it isn't.

@thedrow

This comment has been minimized.

Contributor

thedrow commented Jun 21, 2015

Other pull requests related to Python 3: #390 #399

@jamadden

This comment has been minimized.

Member

jamadden commented Jul 13, 2015

Just like with #248, 1.1a2 has been released with no unaccounted for failures under Python 3. Master currently has several improvements but only one specific to Python 3, and it's minor. I think we can consider the major thrust of this issue to be completed. Please open new issues/PRs for specific issues with Python 3 support. Thanks everyone!

@jamadden jamadden closed this Jul 13, 2015

@mjumbewu

This comment has been minimized.

mjumbewu commented Jul 13, 2015

👏

@ramnes

This comment has been minimized.

ramnes commented Jul 13, 2015

👯

@ultrabug

This comment has been minimized.

ultrabug commented Jul 13, 2015

💃

@giampaolo

This comment has been minimized.

giampaolo commented Jul 13, 2015

This is awesome! Glad to see one of the biggest stoppers for python 3 adoption finally got ported.

@tebanep

This comment has been minimized.

tebanep commented Jul 13, 2015

😀🎉🎉🎉

On Mon, Jul 13, 2015, 1:15 PM giampaolo notifications@github.com wrote:

This is awesome! Glad to see one of the biggest stoppers for python 3
adoption finally supports Python 3.


Reply to this email directly or view it on GitHub
#38 (comment).

@zubinmehta

This comment has been minimized.

zubinmehta commented Jul 14, 2015

:-)

@sylvinus

This comment has been minimized.

sylvinus commented Jul 14, 2015

Congrats!!

@chuliang

This comment has been minimized.

chuliang commented Jul 14, 2015

Good job !

@maguowei

This comment has been minimized.

maguowei commented Jul 14, 2015

Great Job ! 🍺🍉👏

@brunoalano

This comment has been minimized.

brunoalano commented Jul 14, 2015

Yay (:

@waynew

This comment has been minimized.

waynew commented Jul 14, 2015

Great job, and a huge thank you to everyone involved in this!

@sieben

This comment has been minimized.

sieben commented Jul 14, 2015

👍

@svieira

This comment has been minimized.

svieira commented Jul 14, 2015

🌃🎆🎇 Fantastic, fantastic, fantastic! Thank you all!

@mavier

This comment has been minimized.

mavier commented Jul 14, 2015

👍

@gitaarik

This comment has been minimized.

gitaarik commented Oct 7, 2015

🏄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment