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

Add Python 3 Support #6

Closed
oubiwann opened this Issue Dec 3, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@oubiwann
Contributor

oubiwann commented Dec 3, 2014

Python 3 is pretty much all I use these days. I'll give it a whirl and see if any issues pop up.

@oubiwann

This comment has been minimized.

Show comment
Hide comment
@oubiwann

oubiwann Dec 6, 2014

Contributor

I've started working on this:

  • IErlang successfully builds and patches for both Python 2 and 3 (with 3 getting preference)
  • Currently looking into str/bytes issues with IErlang session.py patch

Branch is here:

Contributor

oubiwann commented Dec 6, 2014

I've started working on this:

  • IErlang successfully builds and patches for both Python 2 and 3 (with 3 getting preference)
  • Currently looking into str/bytes issues with IErlang session.py patch

Branch is here:

@robbielynch

This comment has been minimized.

Show comment
Hide comment
@robbielynch

robbielynch Dec 16, 2014

Owner

I remember trying this before. It's been a few months since I looked into it, so I'm a bit rusty on the details. The command to start ipython using the erlang kernel is the problem...

OPT_KERN_MGR_CMD='["$(ESCRIPT)", "$(IPY_KERN)", "{connection_file}"]'

Python2.7 accepts byte strings from the command line, where as Python3 accepts unicode strings. I believe that's where the error is coming from, but again, this is just off the top of my head.

Owner

robbielynch commented Dec 16, 2014

I remember trying this before. It's been a few months since I looked into it, so I'm a bit rusty on the details. The command to start ipython using the erlang kernel is the problem...

OPT_KERN_MGR_CMD='["$(ESCRIPT)", "$(IPY_KERN)", "{connection_file}"]'

Python2.7 accepts byte strings from the command line, where as Python3 accepts unicode strings. I believe that's where the error is coming from, but again, this is just off the top of my head.

@oubiwann

This comment has been minimized.

Show comment
Hide comment
@oubiwann

oubiwann Dec 21, 2014

Contributor

Oh, nice tip -- thanks.

Btw, I'm working on a project that is supporting NumpPy and SciPy from LFE/Erlang. When I've made some more progress on it, I'll send you a link to an IErlang notebook -- you're going to love it :-)

Contributor

oubiwann commented Dec 21, 2014

Oh, nice tip -- thanks.

Btw, I'm working on a project that is supporting NumpPy and SciPy from LFE/Erlang. When I've made some more progress on it, I'll send you a link to an IErlang notebook -- you're going to love it :-)

@robbielynch

This comment has been minimized.

Show comment
Hide comment
@robbielynch

robbielynch Feb 11, 2015

Owner

Finally, support has been added for python3.4.*

The solution is pretty hacky, and not pretty on the eye.

I added

EMPTY_BYTE_STRING=\`python3 -c "print(''.encode())"`

to the makefile. Because the problem with python3 treats command line strings as Strings, where as Python2 treats them as byte strings. IPython only accepts byte strings.

--Session.key=$(EMPTY_BYTE_STRING) \
--Session.keyfile=$(EMPTY_BYTE_STRING)

So it's a round-about way of getting the byte string. Not ideal, but it works.

Owner

robbielynch commented Feb 11, 2015

Finally, support has been added for python3.4.*

The solution is pretty hacky, and not pretty on the eye.

I added

EMPTY_BYTE_STRING=\`python3 -c "print(''.encode())"`

to the makefile. Because the problem with python3 treats command line strings as Strings, where as Python2 treats them as byte strings. IPython only accepts byte strings.

--Session.key=$(EMPTY_BYTE_STRING) \
--Session.keyfile=$(EMPTY_BYTE_STRING)

So it's a round-about way of getting the byte string. Not ideal, but it works.

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