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

Switch to py3 #87

heikoheiko opened this Issue Jul 8, 2016 · 3 comments


None yet
6 participants

heikoheiko commented Jul 8, 2016

Q: Shall we also break py2 compatibility and use new py3 features?
Yes, py3 only.

General information about the transition can be found in


  • replace encode('hex') with a py3 compatible variant (#1158)
  • replace decode('hex') with a py3 compatible variant (#1158)
  • use compatible imports
  • get rid of own dependency forks
    • pystun
      • looks like this is not maintained any more, what do we do about it? Seems to work for now.
    • ethereum
      • We'll stay with 1.6.1 for now. It's compatible with py3 and doesn't break the API. In the long term we want to move to and py-evm.
  • Check library dependencies, caniusepython3 lists 5 dependencies that need to be updated:
    • filelock
    • gevent-websocket
    • marshmallow-polyfield
    • miniupnpc
    • tinyrpc


  • Remove usage of [value|keys|items]iter
  • Remove future imports
  • Remove __future__ imports
  • bytearray objects work differently

Fix tests

This is an overview over which tests have been fixed already. See the palango/py3-fixes branch

  • unit
  • smart_contracts
  • property
  • long_running
  • integration
  • api

Once on python3

  • Check division operators

  • Remove python 2 variants

  • See where list(...) around old iter calls is needed

  • switch HTTP statuses to HTTPStatus

  • Add type annotations to important interfaces

  • Run mypy analysis, see where type signatures make sense

  • Adapt linux and macOS build infrastructure for py3

py3 porting gotchas

  • Blockchain calls that used to return None now return b''
  • Blockchain calls that used to return str now return bytes, we have to define how we want to handle this

This comment has been minimized.


LefterisJP commented Oct 20, 2016

@heikoheiko Please let's not break py2 compatibility.

But yes we should make raiden py3 compatible and have a separate tox environment for py3 just like we have in pyethereum.

@andrevmatos andrevmatos self-assigned this Nov 16, 2017

@andrevmatos andrevmatos added this to the Next minor release milestone Nov 16, 2017


This comment has been minimized.


andrevmatos commented Nov 16, 2017

I'm going to work on this for next sprint. As most of our dependencies already announced they're deprecating py2 support, I'd like to work in the direction of full migration to python3 when this gets fully solved.


This comment has been minimized.


LefterisJP commented Dec 5, 2017

As discussed in the sprint planning meeting I have completely changed my mind since last year and I am wondering why do we want to keep py2 compatibiity instead of just deprecating it?

@konradkonrad @heikoheiko @hackaugusto Are there any reasons to support both py2 and py3 instead of just opting for a complete switch to py3?

The way I see it having a hybrid approach we end up putting quite a bit more work on ourselves as we have to write hybrid code for both python versions.

@palango palango changed the title from py3 compatibility to Switch to py3 Dec 6, 2017

@palango palango referenced this issue Dec 19, 2017


py3 conversion #1193

palango added a commit to palango/raiden that referenced this issue Jan 15, 2018

err508 pushed a commit that referenced this issue Aug 22, 2018

Merge pull request #87 from loredanacirstea/0.5.0-breaking-changes
Fix upcoming solc 0.5.0 breaking changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment