For the most part, there are simple changes that can be preformed by an upgrade utility called 2to3, but beyond this there are some subtle issues caused by the new string handling mechanisms that must be fixed manually. Strings and string encoding were the cause most of our problems with PyMW.
This will break compatibility with Python versions < 2.6, is that an issue for any BOINC projects? I know the old VM was running Python 2.5, so that makes me a little nervous. I think the following would be a good approach: 1. Complete any existing Python changes currently in development and hold any new changes until the upgrade is complete 2. Survey the Python code base and build a list of everything that needs to be modified 3. Make sure that any Python libraries in use (if any) have Python 3 support 4. Decide on a standard way of wrapping redundancies required to support 2.6 and Python 3 (to minimize the ugliness Nicolás mentioned) 5. If one doesn't exist, create a set of tests to exercise as much of the code as possible 6. Run scripts with "-3" switch to find non-trivial issues and fix all these warnings (under Python 2.6) 7. Run 2to3 on all existing code, produce diffs for each file and look over the changes to ensure they are correct 8. Apply changes and test with both Python 2.6 and 3.1 Here is the official overview of Python 3 changes: http://docs.python.org/release/3.0.1/whatsnew/3.0.html -- Jeremy On Sat, Jun 19, 2010 at 9:40 PM, David Anderson <[email protected]>wrote: > By all means, let's make the python code compatible with both 2.6 and 3.x. > What types of changes are required? > -- D > > Jeremy Cowles wrote: > >> That's not entirely true, you can keep one code base and support both 2.6 >> and 3.x without too much effort. We are in the process of doing this now >> with PyMW. >> >> Besides, the BOINC Python code must be upgraded at /some/ point; I know >> that >> doesn't need to be today, but this problem isn't going to go away. >> >> -- >> Jeremy >> >> >> >> 2010/6/19 Nicolás Alvarez <[email protected]> >> >> On 6/19/10, Jeremy Cowles <[email protected]> wrote: >>> >>>> We are in the midst of porting PyMW to Python 3. During this process, I >>>> realized that we can't fully support Python 3 unless BOINC supports it >>>> as >>>> well. >>>> >>>> I'm assuming BOINC does not support Python 3 currently, is there a plan >>>> >>> for >>> >>>> it in the future? >>>> >>>> Having done this conversion with PyMW, I am willing to help out with the >>>> transition, if extra brain/code is needed :) >>>> >>> Python3 is not backwards-compatible. You would need a lot of redundant >>> code and version checks to keep code compatible with *both* 2.x and >>> 3.x; and I doubt devs are willing to require projects to upgrade to >>> Python 3.x... >>> >>> -- >>> Nicolas >>> >>> _______________________________________________ >> boinc_dev mailing list >> [email protected] >> http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev >> To unsubscribe, visit the above URL and >> (near bottom of page) enter your email address. >> > > _______________________________________________ boinc_dev mailing list [email protected] http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev To unsubscribe, visit the above URL and (near bottom of page) enter your email address.
