CloudBolt is aiming to support Python 3 by version 8.0, and any custom Plug-ins or Actions must also be updated before upgrading. Here is a brief guide to updating your Python code to be compatible with both Python 2 and 3.
One of the easiest tools to automatically check your plugin compatibility is 2to3. Run it on the source files of your Plug-ins, and a diff against the original source file is printed.
Most Plug-ins and Actions won't be using methods or syntax that have significant changes. But there are a few common differences that you should review.
Step 1: Print statements need to be a method:
Step 2: Raising exceptions should also use a method to set a specific error message:
Step 3: Catching exceptions need to use 'as' instead of a comma:
Step 4 Unicode changes will impact how data is read from external sources like the 'requests' library:
Step 5: String formatting has changed, and the old % formatting is no longer allowed:
Here are a few excellent resources on the topic that can provide more detailed information:
If you have any trouble updating your code, please review those resources, and feel free to contact CloudBolt support at email@example.com.