Python/import.c defines magic word which is used in the beginning of .pyc files to verify if .pyc files have been generated by compatible version of Python. Python 2 supports undocumented -U option increases magic word by 1. Python 3 uses unicode strings by default and doesn't support -U option, but seemingly incorrect change was committed in r55013, which causes that magic word is always increased by 1 in Python 3 in contrary to documentation, which says that it could only happen with some command line options. This problem cannot be fixed in Python 3.1.2 for compatibility with e.g. 3.1.1, but it can be fixed in 3.2. Additionally documentation in 3.1.2 can be fixed.
I don't see a bug here. The value returned by imp.get_magic() matches the first bytes of a bytecode file. That's all that matters. Of course, we could remove the global variable and just use the defined constant; but that's just an optimization, not a bugfix. PS. The two uploaded patches look about the same?
I think the point is more of self-documentation not being deceiving. Here someone tries to use import.c 's embedded documentation about existing magic numbers and he/she gets mystified because the actual magic number doesn't seem to correspond. Also, it's true that the "Unicode mode fixup" is obsolete and should be removed anyway.