Some thoughts on possible fixes:
Quick fix #1: Change the pointer type to 'unsigned long' in Python-Ogre (I think that's 32 bits on most 32-bit compilers and 64 bits on most 64-bit compilers, but I'm not 100% sure, might want to check that on 32-bit and 64-bit gcc and Microsoft compilers before you patch it into svn trunk).
Quick fix #2: Since PyOgre has a rather finicky many-step manual-intervention-intensive, buggy build process (I recall at least having to manually edit one script to tone down the number of resource-intensive g++ processes it launches) and it's been months since I did it, I really don't want to rebuild it if I don't have to. So I'm not going to change PyOgre. Instead, I'm going to essentially manually do what SWIG does automatically. That is, write a C++ function that does nothing but pass its parameters to writeData(), then export it with extern 'C' linkage and call it with ctypes. Wash, rinse, repeat for every function I need that takes a buggy pointer.
Real fix #1: IMHO a more 'proper' fix would be, when compiling Ogre and generating the wrapper, first compile a test program with the same compiler that will be used to compile Ogre. The test program prints out the sizeof() a pointer and various integer types. Then pick an integer type whose size matches the size of the pointer type.
Real fix #2: It seems that, in the dim and distant past, Python-Ogre may have used a dedicated type to wrap pointers. Following the suggestions of a Google groups thread, I tried using ogre.castAsVoidPtr (in the thread, it's called CastVoidPtr, but my version of Python-Ogre, a fairly recent svn, doesn't have a function of that name). But I got this:
Boost.Python.ArgumentError: Python argument types in
HardwareVertexBuffer.writeData(HardwareVertexBuffer, int, int, void*, bool)
did not match C++ signature:
writeData(Ogre::HardwareBuffer {lvalue} inst, unsigned long offset, unsigned long length, unsigned int pSource, bool discardWholeBuffer=False)
I think that it's cleaner to have different types for pointers and integers, with support for casting between. Number one, it's safer; if you accidentally use a pointer where you need an integer or vice versa it will fail immediately with an informative error message instead of blithely calling Ogre with an incorrect address so the C++ code writes stuff into an arbitrary locations and causes a much more problematic memory corruption bug. Number two, it matches the C model. There's a lot to be said for consistency.
But apparently someone, at some point between the 2007 thread and my last SVN checkout a couple months ago, made a conscious decision that 'integers-are-pointers' is better for Python-Ogre. I respectfully disagree, and I'd even go so far as to say that automatically building correctly on platforms with all pointer sizes might be a reason to switch back to this model, if you're willing to break backward compatibility, make both wrappers available, or add some kind of compatibility layer (e.g. Python code to check if the parameter is whatever Python type castAsVoidPtr() returns or a Python integer, and convert the one that's not used by the underlying code to the one that is). Bonus points if the compatibility layer accepts ctypes pointers as well, and the support for integers-as-pointers can be turned on or off by the application (so integer pointers can be used by apps that need them for backwards compatibility or whatever unfathomable reasons were provided for making the switch to integers-as-pointers in the first place, while people like me can switch the feature off to catch bugs or leftover integers-as-pointers usages if we're migrating our code base away from them).
BTW, here is the thread:
http://groups.google.com/group/python-ogre-developers/browse_thread/thread/398643b83c1cc56c?hl=en
Finally, I'd like to say that, just because the two quick workarounds exist, doesn't mean one of the two real fixes isn't necessary or appreciated.