Skip to content

Conversation

@cclauss
Copy link
Contributor

@cclauss cclauss commented Oct 16, 2018

The CLA is only required for non-trivial changes but this is a trivial change.

Discovered via #7410 @ https://travis-ci.org/openssl/openssl/jobs/442003489#L440

@openssl-machine openssl-machine added the hold: cla required The contributor needs to submit a license agreement label Oct 16, 2018
@mspncp
Copy link
Contributor

mspncp commented Oct 16, 2018

Thanks @cclauss for your contribution. But things are not so easy, because some people have python2 and others python3 as default. The most trivial way to fix this would be to change the shebang line to use python2 explicitly.

#!/usr/bin/python2

Alternatively, and more flexibly, you can add the following line to the beginning of the file

from __future__ import print_function

which will make print a function in python2 and make both python2 and python3 happy. (At least as far as I can see in the case of helper.py, because it is very simple and does not do any sophisticated string handling, so there should not be any unicode issues.)

As for the license: I agree that it's a trivial change. You need to add a single line containing CLA: trivial to the body of the commit message (separated from the title by an empty line) to please the cla-bot.

Since it's a tiny pr, feel free to just amend your previous commit and force-push.

@mspncp
Copy link
Contributor

mspncp commented Oct 16, 2018

Sorry for the lengthy explanation, @cclauss; of course you know about print_function :-)

@cclauss
Copy link
Contributor Author

cclauss commented Oct 16, 2018

Actually things are so easy because this PR already works as expected on both Python 2 and on Python 3. The future import is only required for print statements that contain a comma or that will need a parameter like end= or file=. With just 442 days left until the end of life of Python 2, it would be a mistake to put a Python 2-only shebang line on this file. The goal of this PR is to allow this script to run on both Python 2 and Python 3, not to force it to run on Python 2 only. Many Linux distros now ship with Python 3 only. We do not want to force users to install legacy Python just to run the fuzzer.

Copy link
Contributor

@mspncp mspncp left a comment

Choose a reason for hiding this comment

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

The future import is only required for print statements that contain a comma or that will need a parameter like end= or file=

Thanks for the explanation, I did not know that yet. In that case, you might as well omit the future import. And I agree that it's due time for python3 :-).

I'll approve as soon as the cla-bot has been pacified.

@mspncp
Copy link
Contributor

mspncp commented Oct 16, 2018

Ah, I'm stupid: this always worked, because print(foo) is just a print statement with superfluous parentheses, right?

@cclauss
Copy link
Contributor Author

cclauss commented Oct 16, 2018

Correct. That is why the commas are an issue because they form a tuple.

@openssl-machine openssl-machine removed the hold: cla required The contributor needs to submit a license agreement label Oct 16, 2018
@mspncp mspncp added branch: master Applies to master branch branch: 1.1.1 Applies to OpenSSL_1_1_1-stable branch (EOL) approval: review pending This pull request needs review by a committer labels Oct 16, 2018
@paulidale paulidale added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Oct 17, 2018
@mspncp
Copy link
Contributor

mspncp commented Oct 17, 2018

Merged, thanks!

master (83e4533)
1.1.1 (391f76f)

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

Labels

approval: done This pull request has the required number of approvals branch: master Applies to master branch branch: 1.1.1 Applies to OpenSSL_1_1_1-stable branch (EOL)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants