[Patches] [ python-Patches-1093253 ] Refactoring Python/import.c

SourceForge.net noreply at sourceforge.net
Fri Dec 31 14:57:04 CET 2004


Patches item #1093253, was opened at 2004-12-30 12:50
Message generated for change (Comment added) made by mwh
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1093253&group_id=5470

Category: Core (C code)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Thomas Heller (theller)
Assigned to: Nobody/Anonymous (nobody)
Summary: Refactoring Python/import.c

Initial Comment:
This patch refactores Python/import.c.

find_module() was changed to return an PyObject*
pointer which contains the module's pathname, instead
of filling out a char* buffer.

load_module() accepts the PyObject* pathname instead of
a char*.

The patch is probably missing some error checking, and
the 8 character hack for loading extensions on OS2 is
not implemented, but the test case runs without errors
on Windows XP pro.

If a change in spirit of this patch is accepted, I'm
willing to further work on it so that eventually
unicode entries on sys.path, which can not be encoded
with the default file system encodings, will work as
expected (currently they don't).

See also:
http://mail.python.org/pipermail/python-list/2004-December/256969.html

----------------------------------------------------------------------

>Comment By: Michael Hudson (mwh)
Date: 2004-12-31 13:57

Message:
Logged In: YES 
user_id=6656

Applied the patch and built on OS X.  This was the result:

$ ./python.exe 
'import site' failed; use -v for traceback
../Python/import.c:1496: failed assertion `dirlen <= MAXPATHLEN'
Abort trap

dirlen is 796092779, which seems fishy :)  An uninitialized variable, 
maybe?  Haven't looked, really...


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1093253&group_id=5470


More information about the Patches mailing list