Closed Bug 378043 Opened 17 years ago Closed 12 years ago

pyxpcom: Add the NS_XPCOM_CURRENT_PROCESS_DIR to sys.path

Categories

(Other Applications Graveyard :: PyXPCOM, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: knowikow, Unassigned)

References

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.5 (like Gecko) (Kubuntu)
Build Identifier: 1.9a4pre

As there is already stated in a comment in extensions/python/xpcom/src/dllman.cpp, the application path should also be added to sys.path -- at least when building xulrunner.
Otherwise one has a hard time importing local python modules that are shipped with the application.

Reproducible: Always
Come to think of it, maybe adding NS_XPCOM_COMPONENT_DIR instead of NS_XPCOM_CURRENT_PROCESS_DIR would even be better
I can't imagine that it's a good idea to put python modules directly in the appdir or the components dir. Instead, we should be using appdir/python-lib, and all extensiondirs/python-lib.
That would be ok for me. Actually, the patch adds appdir/python. I don't know how to automatically add the extensiondirs, though.
Thank you for the help.

This patch now adds {app}/python-lib and (hopefully) all {extension-dirs}/python-lib.
I tested it briefly, and it seems to work on Linux, at least for (app). I haven't tested the extension dirs yet.
Attachment #262140 - Attachment is obsolete: true
Blocks: 468835
Component: XPCOM → PyXPCOM
Product: Core → Other Applications
QA Contact: xpcom → pyxpcom
Expired - Pyxpcom has added "bin/python" to the Python sys.path for a long time now, so this is supported.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Product: Other Applications → Other Applications Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: