[Python-Dev] porting problems

Guido van Rossum guido@python.org
Fri, 13 Jun 2003 09:18:14 -0400


> Problem 1:
> I have compiled python2.2.3c1 for the xbox and the gamecube. When I import a
> large module (generated by swig) the xbox version takes 6MB whilst the
> gamecube takes 1MB. This is despite using the same custom malloc replacement
> code. This problem occurrs whenever the python module being imported gets
> bigger than a few thousand lines long. I do not know why the versions do not
> behave identically as they both are using a near identical hand generated
> pyconfig.h.

I believe the answer is not in Python, but in the details of the
architectures; *something* must be different, and I can't guess what.
I think you'll only find the answer by either (a) debugging the heck
out of it, or (b) asking on xbox and gamecube forums.

> Problem 2:
>   What d o I need to do to get errors on import etc to show up in my own
> custom error printing routines. t the moment I cannot find them unless I am
> using the very high python/c interface functions. (In this case I can set
> stderr to a custom class and everything works fine)

This is a Python question; it's probably best asked on c.l.py; I
recommend that you give a lot more detail about what you mean by
"custom error printing routines" -- without understanding that part I
can't even begin to understand the rest of your question.  (It's also
not clear what "errors on import etc" you are interested in catching
-- is this ImportError exceptions, or exceptions raised by the
imported module's code when it runs?  Is this about C extension
modules or Python modules?  And what do you mean when referring to
"very high python/c interface funtions"?  Etc.)  Please post those
details with your question on c.l.py.

--Guido van Rossum (home page: http://www.python.org/~guido/)