confluentinc / cp-docker-images

[DEPRECATED] Docker images for Confluent Platform.
Apache License 2.0
1.14k stars 704 forks source link

print() is a function in modern Python #823

Closed cclauss closed 3 years ago

cclauss commented 4 years ago

Legacy print statements are syntax errors in Python 3 but print() function works as expected in both Python 2 and Python 3.

xrange() was removed in Python 3 in favour of an iterator-base version of range(). In Python 2, for low values for n there is no appreciable difference xrange(n) and range(n).

ghost commented 4 years ago

It looks like @cclauss hasn't signed our Contributor License Agreement, yet.

The purpose of a CLA is to ensure that the guardian of a project's outputs has the necessary ownership or grants of rights over all contributions to allow them to distribute under the chosen licence. Wikipedia

You can read and sign our full Contributor License Agreement here.

Once you've signed reply with [clabot:check] to prove it.

Appreciation of efforts,

clabot

OneCricketeer commented 4 years ago

Are these the only issues?

You could try running 2to3 on the script

cclauss commented 4 years ago

2to3 is bad idea. It often breaks Python 2 functionality to achieve Python 3 compatibility. Use futuzize or modernize instead if you want to retain compatibility with Python 2.

cclauss commented 4 years ago

This PR is the syntax errors plus the undefined names. I would recommend landing these change and testing functionality before adding other changes.

OneCricketeer commented 4 years ago

Fair enough, I was just suggesting upgrading the whole script to py3, not exactly prescribing the solution