[issue6834] use different mechanism for pythonw on osx

Ronald Oussoren report at bugs.python.org
Tue Sep 22 12:48:56 CEST 2009


Ronald Oussoren <ronaldoussoren at mac.com> added the comment:

The attached file 'pythonw.c' is a first version of a better pythonw 
executable.

This version uses posix_spawn rather than execv to start the real 
interpreter. The main advantage of the new implementation is that 'arch 
-ppc pythonw' works as expected, with the current version of pythonw the 
'arch' command only affects the pythonw executable and not the real 
interpreter.

Todo:
* I'm not use if the '-X32bit' option is a good idea or not.

  The basic idea of this is to provide an easy way to force python to 
  start in 32bit mode (for use in #! lines) for scripts that need it
  (basicly anything that needs to access Carbon GUI APIs, including most
  current Python GUI libraries)

* The implementation of '-X32bit' is sucky, it contains a copy of the
  getopt format string from Py_Main in Modules/main.c

* The path to the real executable is hardcoded for a standard framework
  install of 2.7 (easily changed to the same mechanism as used by
  the current edition of pythonw)

  What I'd like to do is link pythonw to the framework and use dyld
  introspection to deduce the path to the real executable. That's 
  slightly more complicated, but would provide a clean way to reuse
  the executable in tools like virtualenv without recompiling.

----------
Added file: http://bugs.python.org/file14949/pythonw.c

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6834>
_______________________________________


More information about the Python-bugs-list mailing list