Skip to content
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

Drop Python 2.6, add Python 3 test compatibility #115

Merged
merged 13 commits into from
Jan 29, 2020

Conversation

tofu-rocketry
Copy link
Member

@tofu-rocketry tofu-rocketry commented Jan 24, 2020

Partially addresses #91.

N.B. Removes support for Python 2.6. So we'll need to go up a major (!) version number for the next release.

This pull request adds basic Python 3 compatibility such that the Travis tests can run successfully. There are certainly other things that will need fixing to ensure SSM actually works with Python 3 (including optparse deprecation).

References for quopri changes:
Python 2
Python 3

This ensures that file opjects for stdin etc. are opened in text mode
for Python 2 & 3 compatability.
- Add universal_newlines for Python 3 compatability with Python 2
strings.
- Unpick entablement of the two Popen calls as using communicate() is
best practice over writing to streams directly. (This was also
incompatible with Python 3.)
- This is no longer needed as there's no need to support versions of
Python older than 2.6 and the ssl module is no longer used in this file
anyway.
qopri.encodestring() only accepts bytes objects and encodestring()
and decodestring() both output bytes objects in Python 3. To maintain
compatibility with Python 2, this requires encoding the input to
encodestring to bytes (a no-op on Python 2) and then checking to see if
we need to decode on the other side (which will depend on the version of
Python).
@tofu-rocketry tofu-rocketry added this to the 3.0.0 milestone Jan 24, 2020
@tofu-rocketry tofu-rocketry requested a review from a team January 24, 2020 16:01
@tofu-rocketry tofu-rocketry self-assigned this Jan 24, 2020
@tofu-rocketry tofu-rocketry mentioned this pull request Jan 24, 2020
6 tasks
@tofu-rocketry tofu-rocketry marked this pull request as ready for review January 24, 2020 16:18
ssm/crypto.py Outdated Show resolved Hide resolved
Co-Authored-By: gregcorbett <[email protected]>
Copy link
Member

@gregcorbett gregcorbett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I think I have managed to parse the documentation around the universal newlines option - so I am ambivalent on the adding of additional comments.

@tofu-rocketry tofu-rocketry merged commit fc33a88 into apel:dev Jan 29, 2020
@tofu-rocketry tofu-rocketry deleted the python3 branch January 29, 2020 16:53
@tofu-rocketry
Copy link
Member Author

I accept your ambivalence. ⚖️

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

Successfully merging this pull request may close these issues.

2 participants