This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: pydoc crash on MacOS X
Type: Stage:
Components: macOS Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jackjansen Nosy List: jackjansen, ronaldoussoren
Priority: normal Keywords:

Created on 2003-11-25 12:50 by ronaldoussoren, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
objctest.tar.gz ronaldoussoren, 2003-11-25 12:50
Messages (3)
msg19131 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2003-11-25 12:50
pydoc will crash the python interpreter on MacOS X if an 
extension module defines an Objective-C class or category.

The attached tarball contains an example of this, if you build 
the extension module and then run dotest.py the interpreter 
will crash.

The cause for this is the call to 'imp.load_module' in 
pydoc.py. This will load the extension module with __temp__ 
as it's name. load_module will load the executable image, 
search for the init__temp__ function and will then try to 
unload the image because that function is not found. 
Unloading the image (using NSUnloadModule, see 
dynload_next.c) will cause the crash because it is impossible 
to unload executable images that contain an Objective-C 
class or category.

A real world example: install PyObjC and run 'pydoc -k 
hello'.
msg19132 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2003-11-25 14:06
Logged In: YES 
user_id=45365

This is a duplicate of <https://sourceforge.net/tracker/?
func=detail&aid=838140&group_id=5470&atid=105470>, but I'm 
leaving it in for the moment as it has a real-life example of when 
modules are unloaded.

Ronald: could you you see whether you agree with my suggestions 
over there that PyObjC modules should solve this themselves (as 
opposed to disabling unloading in general)?
msg19133 - (view) Author: Jack Jansen (jackjansen) * (Python committer) Date: 2004-07-15 22:32
Logged In: YES 
user_id=45365

This is a duplicate of #838140, so it should be fixed (for 2.4 at least). 
Please give it a try, and reopen the report if the problem still exists.
History
Date User Action Args
2022-04-11 14:56:01adminsetgithub: 39599
2003-11-25 12:50:22ronaldoussorencreate