Local modules ignored for standard library modules

Bug #677803 reported by agricola
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NakedMud
New
Undecided
Unassigned

Bug Description

When NakedMud is run, it adds the lib/pymodules/ directory to Python's sys.path using append - this means that if one of your pymodules has the same name as another module on the Python path (for instance, the "stat" module in the standard library) your module will not be imported. This is contrary to standard Python behaviour - when Python executes a script it places the current working directory at index 0 of sys.path.

Change line 131 of src/scripts/pyplugs.c from:

    PyList_Append(path, Py_BuildValue("s", PYMOD_LIB));

to:

    PyList_Insert(path, 0, Py_BuildValue("s", PYMOD_LIB));

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.