getpath differences Linux vs Windows

I have been integrating python scripting support into my project and have been impressed at how easy it has been with boost::python and the excelant documentation. I ran into a technical 'problem' today while writing up Makefiles for my project. It is not really a problem, just unexpected behavior that I want to propose a change for. But first, a little background info.. I have been doing most of my development so far in windows and just started porting my project to linux yesterday. Because I want to make using this project as easy as possible and because I wanted a python debug build, I integrated python into my building process in windows. This involved creating a new visual studio project for both pythonlib, and python exe, as well as a few of the libraries such as _ctypes, _elementtree, _multiprocessing, and _socket. All these projects compile with my project and the python Lib directory from the install is kept in a folder that I then copy into the final destination folder if necessary. I did all this work so that my users could check out my project, build it, and run it with python without installing python. Also I wanted a debug build, as mentioned earlier. Anyway, enough background, this works perfectly on windows because in PC/getpathp.c when everything goes to hell and you cant figure out a path you default to ./Lib Because of this behavior, I can copy the Lib directory into the bin dir and run python no problem. I throw all the .py into $(BIN_DIR)/Lib and the C libs in $(BIN_DIR)/DLLs and python is happy as a clam. My trouble, and the reason for this email, is on linux the behavior is different, and Modules/getpath.c does not default to ./Lib when everything goes to hell, and I get
I am going to spend the rest of my afternoon editing Modules/getpath.c and I thought I would propose updating the non-windows getpath.c file to be more in line with the windows one. Or at least, have it take some pointers from windows. Thanks for your time

Charles Solar wrote:
Probably not going to fly - the current default behaviour follows standard Linux idioms, which differ significantly from those of Windows. The error message tells you how to fix the problem though: make sure PYTHONHOME points to the right place in the environment seen by the embedded interpreter. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia ---------------------------------------------------------------

Yea it most definitely works when I set PYTHONHOME and PYTHONPATH correctly. But my goal is 0 environment monkeying. I do not want my users to have to remember to define those environment variables to get it running. My trouble is that the framework I am writing up is going to be hard enough to convince these guys to use at all, and I want no tricks or gotchas when I present the final solution. This is just a suggestion since I found the windows behavior extremely convenient. Charles On Tue, Jan 26, 2010 at 3:39 PM, Nick Coghlan <ncoghlan@gmail.com> wrote:

On Tue, Jan 26, 2010 at 4:54 PM, Charles Solar <redcomet87@gmail.com> wrote:
Yea it most definitely works when I set PYTHONHOME and PYTHONPATH correctly. But my goal is 0 environment monkeying.
Sounds like you could solve the problem by providing your own getpath.c. -Fred -- Fred L. Drake, Jr. <fdrake at gmail.com> "Chaos is the score upon which reality is written." --Henry Miller

Charles Solar wrote:
Probably not going to fly - the current default behaviour follows standard Linux idioms, which differ significantly from those of Windows. The error message tells you how to fix the problem though: make sure PYTHONHOME points to the right place in the environment seen by the embedded interpreter. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia ---------------------------------------------------------------

Yea it most definitely works when I set PYTHONHOME and PYTHONPATH correctly. But my goal is 0 environment monkeying. I do not want my users to have to remember to define those environment variables to get it running. My trouble is that the framework I am writing up is going to be hard enough to convince these guys to use at all, and I want no tricks or gotchas when I present the final solution. This is just a suggestion since I found the windows behavior extremely convenient. Charles On Tue, Jan 26, 2010 at 3:39 PM, Nick Coghlan <ncoghlan@gmail.com> wrote:

On Tue, Jan 26, 2010 at 4:54 PM, Charles Solar <redcomet87@gmail.com> wrote:
Yea it most definitely works when I set PYTHONHOME and PYTHONPATH correctly. But my goal is 0 environment monkeying.
Sounds like you could solve the problem by providing your own getpath.c. -Fred -- Fred L. Drake, Jr. <fdrake at gmail.com> "Chaos is the score upon which reality is written." --Henry Miller
participants (3)
-
Charles Solar
-
Fred Drake
-
Nick Coghlan