Migration to Python 3

Just to see what would happen I tried a build with 3.2 but it fails fairly quickly with:

c:\panda3d\dtool\src\interrogatedb\py_panda.cxx(211) : error C3861: 'PyUnicode_AsUTF8': identifier not found
c:\panda3d\dtool\src\interrogatedb\py_panda.cxx(223) : error C3861: 'PyUnicode_AsUTF8': identifier not found
c:\panda3d\dtool\src\interrogatedb\py_panda.cxx(253) : error C3861: 'PyUnicode_AsUTF8': identifier not found
c:\panda3d\dtool\src\interrogatedb\py_panda.cxx(265) : error C3861: 'PyUnicode_AsUTF8': identifier not found
Storing dependency cache.
Elapsed Time: 1 min 5 sec
The following command returned a non-zero value: cl /wd4996 /wd4275 /wd4267 /wd4101 /wd4273 /Fobuilt/tmp/p3interrogatedb_composite2.obj /nologo /c /arch:SSE2 /Idtool/src/interrogatedb /Ibuilt/tmp /Ibuilt/include /Ithirdparty/win-python/include /DMAKEPANDA= /MD /Zi /O2 /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /Fdbuilt/tmp/p3interrogatedb_composite2.pdb /DBUILDING_DTOOLCONFIG /EHa /Zm300 /DWIN32_VC /DWIN32 /W3 dtool/src/interrogatedb/p3interrogatedb_composite2.cxx
Build terminated.

The 3.3 ref indicates that PyUnicode_AsUTF8 is new in that version so I guess a build with anything less than 3.3 wouldn’t be possible at this point. I’ll wait to see if enn0x has any success building with 3.3 before I try anything more, but I can continue working through the direct tree making changes.

@enn0x: rdb has indicated that creating a direct tree that is compatible with both versions of Python would be preferable so using 2to3 straight up won’t be possible for all the changes, though I am using its output as a reference.

@rdb: Unfortunately I can’t try a 64-bit build right now because I’m still using a fairly old XP box, hopefully that will be changing in a couple of months though.