There's a closed pull request on the Samba Samba Github repository Python2 python3 compat (in lieu of 'six') https://github.com/samba-team/samba/pull/170 Description: Some updates to samba's own compat.py to ease writing python2/python3 compatible code