summaryrefslogtreecommitdiff
path: root/Modules/getpath.c
AgeCommit message (Collapse)AuthorLines
2019-11-07[2.7] bpo-38730: Fix -Wstringop-truncation warnings. (GH-17075)Benjamin Peterson-1/+1
2016-11-11Issue #19398: Extra slash no longer added to sys.path components in case ofSerhiy Storchaka-1/+4
empty compile-time PYTHONPATH components. This fixes some tests in -S or -I modes.
2016-10-08Silenced compiler warnings.Serhiy Storchaka-5/+3
2016-06-02remove (hilarious) defaults for various constants getpath.c needsBenjamin Peterson-23/+2
2013-04-08- Issue #13150, #17512: sysconfig no longer parses the Makefile and config.hdoko@ubuntu.com-4/+19
files when imported, instead doing it at build time. This makes importing sysconfig faster and reduces Python startup time by 20%.
2010-10-07copy_absolute(): keep the relative path if getcwd() failedVictor Stinner-1/+5
Instead of using the undefined content of the 'path' buffer.
2010-07-23Merged revisions 83096 via svnmerge fromRonald Oussoren-1/+1
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83096 | ronald.oussoren | 2010-07-23 17:05:35 +0100 (Fri, 23 Jul 2010) | 13 lines Ensure that sys.prefix can reliably be found on OSX. This fixes a small issue that was exposed by running test_subprocess through regrtest (and hence in a subdirectory). Without this patch running python.exe from the build tree will fail when these tree conditions are true: 1) the CWD is not the root of build tree 2) python.exe is found through $PATH 3) the framework is not yet installed ........
2010-05-09Untabify C files. Will watch buildbots.Antoine Pitrou-48/+48
2010-03-11Issue #7774: Set sys.executable to an empty string if argv[0] has beenVictor Stinner-1/+1
set to an non existent program name and Python is unable to retrieve the real program name. Fix also sysconfig: if sys.executable is an empty string, use the current working directory.
2007-03-10Typos.Georg Brandl-1/+1
2006-07-10Patch #1516912: improve Modules support for OpenVMS.Neal Norwitz-5/+5
2006-04-13spread the extern "C" { } magic pixie dust around. Python itself builds nowAnthony Baxter-0/+11
using a C++ compiler. Still lots and lots of errors in the modules built by setup.py, and a bunch of warnings from g++ in the core.
2006-04-11Some more changes to make code compile under a C++ compiler.Anthony Baxter-1/+1
2006-02-20Patch #931938: prevent setting sys.prefix to ""Georg Brandl-0/+6
2006-01-05squash compiler warning on Mac OSX 10.3Skip Montanaro-0/+4
2005-09-16Change type on variable to silence gcc 4 warning. Call signature was found atBrett Cannon-1/+1
http://darwinsource.opendarwin.org/10.4.2/dyld-43.1/src/dyldAPIs.cpp .
2004-08-08Bug 1003471: Python 1.5.2 security vulnerability still present in 2.3.4Tim Peters-4/+10
That's the title of the report, but the hole was probably plugged since Python 2.0. See corresponding checkin to PC/getpathp.c: a crucial precondition for joinpath() was neither documented nor verified, and there are so many callers with so many conditional paths that no "eyeball analysis" is satisfactory. Now Python dies with a fatal error if the precondition isn't satisfied, instead of allowing a buffer overrun. NOT TESTED! The Windows version of the patch was, but not this one. I don't feel like waiting for someone to notice the patch I attached to the bug report. If it doesn't compile, sorry, but fix it <wink>. If it does compile, it's "obviously correct".
2004-06-26Modules/getpath.c now compiles properly under OS X when using theBrett Cannon-1/+1
--disable-framework build; header file was protected in an #if using the wrong macro to check. Closes bug #978645.
2004-06-24Change comment from C++ style to C.Brett Cannon-1/+1
2004-06-03Fix for #932977: MacOSX does not pass the whole pathname in argv[0] forJack Jansen-0/+17
#!-scripts, only the filename part, and this can lead to incorrect initialization of sys.path and sys.executable if there is another python on $PATH before the one used in #!. The fix was picked up from the darwinports crowd, thanks!
2002-12-31Make sure zip_path is null-terminated, since it's on the stackNeal Norwitz-0/+1
2002-12-30PEP 302 + zipimport:Just van Rossum-0/+18
- new import hooks in import.c, exposed in the sys module - new module called 'zipimport' - various changes to allow bootstrapping from zip files I hope I didn't break the Windows build (or anything else for that matter), but then again, it's been sitting on sf long enough... Regarding the latest discussions on python-dev: zipimport sets pkg.__path__ as specified in PEP 273, and likewise, sys.path item such as /path/to/Archive.zip/subdir/ are supported again.
2002-12-23Squashed compiler warnings by adding casts, making sure prototypes are inJack Jansen-1/+1
scope and looking at types.
2002-12-06Patch #614055: Support OpenVMS.Martin v. Löwis-0/+4
2002-09-13SF # 602108 ensure string is null terminated after strncpyNeal Norwitz-0/+1
2002-01-12Include <unistd.h> in Python.h. Fixes #500924.Martin v. Löwis-4/+0
2001-12-02Changed logic for finding python home in Mac OS X framework Pythons.Jack Jansen-47/+45
Now sys.executable points to the executable again, in stead of to the shared library. The latter is used only for locating the python home.
2001-09-28Be more rigorous about making pathnames absolute, to address SF bugGuido van Rossum-53/+58
#424002. Refactor init_path_from_argv0() and rename to copy_absolute(); add absolutize() which does the same in-place. Clean up whitespace (leading tabs -> spaces, delete trailing spaces/tabs).
2001-08-15With WITH_NEXT_FRAMEWORK defined we now also expect a normal PythonJack Jansen-6/+20
installation. If there is no LANDMARK we assume we're a bare framework in the install directory (again WITH_NEXT_FRAMEWORK only).
2001-08-08Put conditional S_ISDIR definition(s) into pyport.h.Martin v. Löwis-9/+0
2001-07-23Add -E command line switch (ignore environment variables like PYTHONHOMENeil Schemenauer-1/+1
and PYTHONPATH).
2001-01-24Build now happens in toplevel directory, not Modules. Don't monkey withNeil Schemenauer-12/+1
VPATH.
2001-01-23Clean up some comments and the default VERSION.Guido van Rossum-3/+2
2000-09-28Minor ANSIfication: lib_python no longer needs to be initializedFred Drake-4/+1
dynamically to support K&R C since we are requiring an ANSI compiler.
2000-09-27Fix buffer overflow vulnerabilities in calculate_path(). Code usedJeremy Hylton-16/+41
copied strings from environment variables and argv[0] into fixed-length buffers without checking their length. Reported by Stan Bubrouski; advice on fix from John Viega.
2000-09-25fix bug #114290: when interpreter's argv[0] has a relative path makeJeremy Hylton-2/+19
it absolute by joining it with getcwd result. avoid including unnecessary ./ in path but do not test for ../ (more complicated)
2000-09-01REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum-9/+0
This should match the situation in the 1.6b1 tree.
2000-07-22Even more ANSIfication: fix as many function pointers and declarations asThomas Wouters-1/+1
possible.
2000-07-21Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',Thomas Wouters-5/+5
and a couple of functions that were missed in the previous batches. Not terribly tested, but very carefully scrutinized, three times. All these were found by the little findkrc.py that I posted to python-dev, which means there might be more lurking. Cases such as this: long func(a, b) long a; long b; /* flagword */ { and other cases where the last ; in the argument list isn't followed by a newline and an opening curly bracket. Regexps to catch all are welcome, of course ;)
2000-07-16Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in eitherThomas Wouters-1/+1
comments, docstrings or error messages. I fixed two minor things in test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't"). There is a minor style issue involved: Guido seems to have preferred English grammar (behaviour, honour) in a couple places. This patch changes that to American, which is the more prominent style in the source. I prefer English myself, so if English is preferred, I'd be happy to supply a patch myself ;)
2000-07-08ANSI-fied sources, converted to four-space indentation.Fred Drake-338/+329
2000-06-30Change copyright notice - 2nd try.Guido van Rossum-6/+0
2000-06-30Change copyright notice.Guido van Rossum-21/+6
2000-06-28Trent Mick: use size_t instead of int where appropriate (various spots).Guido van Rossum-9/+9
2000-05-26Patch from M.-A. Lemburg:Jeremy Hylton-25/+23
Python on UNIX now trusts PYTHONHOME unconditionally Modules/getpath.c: Landmark changed to os.py. Setting PYTHONHOME now unconditionally sets sys.prefix (and sys.exec_prefix). No further checks are done whether the standard lib can be found in that location or not. This is in sync with the PC subdir getpath implementations. PC/getpathp.c: Landmark changed to os.py. PC/os2vacpp/getpathp.c: Landmark changed to os.py. Note: BAW's checkin on exceptions.c eliminates earlier concerns about a bogus PYTHONHOME value leading to a core dump. Instead it causes a useless sys.path and prevents imports.
2000-05-03Vladimir Marangozov's long-awaited malloc restructuring.Guido van Rossum-1/+1
For more comments, read the patches@python.org archives. For documentation read the comments in mymalloc.h and objimpl.h. (This is not exactly what Vladimir posted to the patches list; I've made a few changes, and Vladimir sent me a fix in private email for a problem that only occurs in debug mode. I'm also holding back on his change to main.c, which seems unnecessary to me.)
1999-01-27Patches by William Lewis for Nextstep descendants.Guido van Rossum-0/+24
1998-04-29When following symlinks to the real executable, use a loop so aGuido van Rossum-1/+2
symlink to a symlink can work. (Jack)
1998-02-06- Use Py_GetPythonHome() instead of getenv("PYTHONHOME").Guido van Rossum-2/+4
- Don't print error messages when Py_FrozenFlag is set.
1998-01-19Instead of a single exists(), differentiate between files, modules,Guido van Rossum-13/+70
executable files, and directories. When expecting a module, we also look for the .pyc or .pyo file.