Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'paths': 0.07; '#include': 0.09; 'prefix': 0.09; 'testing,': 0.09; 'python': 0.11; 'wrote': 0.14; '%s,': 0.16; 'expected,': 0.16; 'path.': 0.16; 'received:fi': 0.16; 'stumbled': 0.16; 'weird': 0.16; 'fix': 0.17; 'char': 0.24; 'header:In-Reply-To:1': 0.27; 'supposed': 0.32; 'problem': 0.35; 'but': 0.35; 'doing': 0.36; 'received:10': 0.37; 'being': 0.38; 'to:addr:python-list': 0.38; 'skip:- 10': 0.38; 'that,': 0.38; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'header:Message-Id:1': 0.63; 'charset:windows-1252': 0.65; 'received:130': 0.73; 'behavior': 0.77; 'const': 0.84; 'it\x92s': 0.84 X-Virus-Scanned: amavisd-new at cc.jyu.fi Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: Py_SetProgramName() and prefixes From: Marko Havu In-Reply-To: Date: Thu, 28 Aug 2014 15:00:40 +0300 Content-Transfer-Encoding: quoted-printable References: To: python-list@python.org X-Mailer: Apple Mail (2.1878.6) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1409227251 news.xs4all.nl 2831 [2001:888:2000:d::a6]:57068 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77200 I wrote earlier: > While doing some testing, I stumbled across some weird behavior on = Python 3.3 and 3.4: Py_GetPrefix(), Py_GetPath() and other functions = that return paths that are supposed to be set by Py_SetProgramName() all = return just =94/=94: >=20 > ---------------- main.c ---------------- > #include > #include > #include >=20 > int main(int argc, const char * argv[]) > { > printf("path: %s\n", getenv("PATH")); > Py_SetProgramName(L"/anaconda/envs/python3.4/bin/python"); > Py_Initialize(); > wprintf(L"prefix: %s\n", Py_GetPrefix()); > PyRun_InteractiveLoop(stdin, ""); > Py_Finalize(); >=20 > return EXIT_SUCCESS; > } > ---------------- Doh. It=92s supposed to be %S, not %s. When I fix that, the prefix is as = expected, but I still have the original problem of Py_Initialize() not = being able to find python in the path. - Marko