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)
Other Applications Graveyard
PyXPCOM
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
Reporter | ||
Comment 1•17 years ago
|
||
Reporter | ||
Comment 2•17 years ago
|
||
Come to think of it, maybe adding NS_XPCOM_COMPONENT_DIR instead of NS_XPCOM_CURRENT_PROCESS_DIR would even be better
Comment 3•17 years ago
|
||
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.
Reporter | ||
Comment 4•17 years ago
|
||
That would be ok for me. Actually, the patch adds appdir/python. I don't know how to automatically add the extensiondirs, though.
Comment 5•17 years ago
|
||
Take the list from http://lxr.mozilla.org/mozilla/source/toolkit/xre/nsXULAppAPI.h#173 See, e.g. http://lxr.mozilla.org/mozilla/source/browser/components/dirprovider/nsBrowserDirectoryProvider.cpp#236 which does something similar to look in extensiondirs/searchplugins.
Reporter | ||
Comment 6•17 years ago
|
||
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
Updated•15 years ago
|
Component: XPCOM → PyXPCOM
Product: Core → Other Applications
QA Contact: xpcom → pyxpcom
Comment 7•12 years ago
|
||
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
Updated•6 years ago
|
Product: Other Applications → Other Applications Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•