Commit Graph

61 Commits

Author SHA1 Message Date
Victor Stinner 354fe7e381 copy_absolute(): keep the relative path if getcwd() failed
Instead of using the undefined content of the 'path' buffer.
2010-10-07 23:37:08 +00:00
Ronald Oussoren c22b718b1a Merged revisions 83096 via svnmerge from
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-07-23 16:12:28 +00:00
Antoine Pitrou c83ea137d7 Untabify C files. Will watch buildbots. 2010-05-09 14:46:46 +00:00
Victor Stinner 4a7e0c858c Issue #7774: Set sys.executable to an empty string if argv[0] has been
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.
2010-03-11 12:34:39 +00:00
Georg Brandl 7478096148 Typos. 2007-03-10 07:38:14 +00:00
Neal Norwitz 2a30cd0ef0 Patch #1516912: improve Modules support for OpenVMS. 2006-07-10 01:18:57 +00:00
Anthony Baxter ac6bd46d5c spread the extern "C" { } magic pixie dust around. Python itself builds now
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-13 02:06:09 +00:00
Anthony Baxter 64182fe0b3 Some more changes to make code compile under a C++ compiler. 2006-04-11 12:14:09 +00:00
Georg Brandl e393bf6fe3 Patch #931938: prevent setting sys.prefix to "" 2006-02-20 17:37:36 +00:00
Skip Montanaro 2b47445234 squash compiler warning on Mac OSX 10.3 2006-01-05 10:49:13 +00:00
Brett Cannon bd9c3f7028 Change type on variable to silence gcc 4 warning. Call signature was found at
http://darwinsource.opendarwin.org/10.4.2/dyld-43.1/src/dyldAPIs.cpp .
2005-09-16 02:43:35 +00:00
Tim Peters ec8c5a9311 Bug 1003471: Python 1.5.2 security vulnerability still present in 2.3.4
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-08-08 01:00:47 +00:00
Brett Cannon f6af76da61 Modules/getpath.c now compiles properly under OS X when using the
--disable-framework build; header file was protected in an #if using the wrong
macro to check.

Closes bug #978645.
2004-06-26 04:03:06 +00:00
Brett Cannon 6cc48148fe Change comment from C++ style to C. 2004-06-24 00:48:44 +00:00
Jack Jansen 1afd4807d9 Fix for #932977: MacOSX does not pass the whole pathname in argv[0] for
#!-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!
2004-06-03 14:33:03 +00:00
Neal Norwitz b70557f13d Make sure zip_path is null-terminated, since it's on the stack 2002-12-31 12:45:12 +00:00
Just van Rossum 52e14d640b PEP 302 + zipimport:
- 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-30 22:08:05 +00:00
Jack Jansen 0a116f3a29 Squashed compiler warnings by adding casts, making sure prototypes are in
scope and looking at types.
2002-12-23 21:03:36 +00:00
Martin v. Löwis 79acb9edfa Patch #614055: Support OpenVMS. 2002-12-06 12:48:53 +00:00
Neal Norwitz bcf9f9eb3b SF # 602108 ensure string is null terminated after strncpy 2002-09-13 14:35:56 +00:00
Martin v. Löwis cdc4451222 Include <unistd.h> in Python.h. Fixes #500924. 2002-01-12 11:05:12 +00:00
Jack Jansen 55070f5d96 Changed logic for finding python home in Mac OS X framework Pythons.
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-12-02 23:56:28 +00:00
Guido van Rossum e296cedef9 Be more rigorous about making pathnames absolute, to address SF bug
#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-09-28 20:00:29 +00:00
Jack Jansen e925faff8e With WITH_NEXT_FRAMEWORK defined we now also expect a normal Python
installation.
If there is no LANDMARK we assume we're a bare framework in the
install directory (again WITH_NEXT_FRAMEWORK only).
2001-08-15 01:14:40 +00:00
Martin v. Löwis f9836ba4fe Put conditional S_ISDIR definition(s) into pyport.h. 2001-08-08 10:28:06 +00:00
Neil Schemenauer 7d4bb9f179 Add -E command line switch (ignore environment variables like PYTHONHOME
and PYTHONPATH).
2001-07-23 16:30:27 +00:00
Neil Schemenauer 6cf0702a79 Build now happens in toplevel directory, not Modules. Don't monkey with
VPATH.
2001-01-24 17:13:11 +00:00
Guido van Rossum d0e74eac6b Clean up some comments and the default VERSION. 2001-01-23 01:57:40 +00:00
Fred Drake b64c2239b0 Minor ANSIfication: lib_python no longer needs to be initialized
dynamically to support K&R C since we are requiring an ANSI compiler.
2000-09-28 14:32:29 +00:00
Jeremy Hylton 6372fe1e40 Fix buffer overflow vulnerabilities in calculate_path(). Code used
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-27 20:51:17 +00:00
Jeremy Hylton 7198ba986d fix bug #114290: when interpreter's argv[0] has a relative path make
it absolute by joining it with getcwd result.  avoid including
    unnecessary ./ in path but do not test for ../ (more complicated)
2000-09-25 17:00:24 +00:00
Guido van Rossum 8586991099 REMOVED all CWI, CNRI and BeOpen copyright markings.
This should match the situation in the 1.6b1 tree.
2000-09-01 23:29:29 +00:00
Thomas Wouters bd4bc4e9e9 Even more ANSIfication: fix as many function pointers and declarations as
possible.
2000-07-22 23:57:55 +00:00
Thomas Wouters f3f33dcf03 Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',
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-21 06:00:07 +00:00
Thomas Wouters 7e47402264 Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in either
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-16 12:04:32 +00:00
Fred Drake edabdc1e9e ANSI-fied sources, converted to four-space indentation. 2000-07-08 06:16:37 +00:00
Guido van Rossum ffcc3813d8 Change copyright notice - 2nd try. 2000-06-30 23:58:06 +00:00
Guido van Rossum fd71b9e9d4 Change copyright notice. 2000-06-30 23:50:40 +00:00
Guido van Rossum b6f657c0cc Trent Mick: use size_t instead of int where appropriate (various spots). 2000-06-28 21:29:03 +00:00
Jeremy Hylton 847a9968e9 Patch from M.-A. Lemburg:
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-26 21:49:07 +00:00
Guido van Rossum b18618dab7 Vladimir Marangozov's long-awaited malloc restructuring.
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.)
2000-05-03 23:44:39 +00:00
Guido van Rossum 54ecc3d24f Patches by William Lewis for Nextstep descendants. 1999-01-27 17:53:11 +00:00
Guido van Rossum 302be44e96 When following symlinks to the real executable, use a loop so a
symlink to a symlink can work.
(Jack)
1998-04-29 21:07:06 +00:00
Guido van Rossum 131c92c069 - Use Py_GetPythonHome() instead of getenv("PYTHONHOME").
- Don't print error messages when Py_FrozenFlag is set.
1998-02-06 22:29:30 +00:00
Guido van Rossum d29806c37e Instead of a single exists(), differentiate between files, modules,
executable files, and directories.  When expecting a module, we also
look for the .pyc or .pyo file.
1998-01-19 22:06:22 +00:00
Guido van Rossum 79f016a262 Remove "Lib/test" from the default path; this is now a package! 1997-12-10 23:38:26 +00:00
Guido van Rossum 266033e89b Change sharedmodules to lib-dynload.
### If you still have sharedmodules in your Modules/Setup file, remove it! ###
1997-10-20 23:20:32 +00:00
Guido van Rossum 6b9fdf529a Globally renamed join() to joinpath() to avoid compilation error on Cray. 1997-08-20 23:48:16 +00:00
Guido van Rossum 21f8497a46 Use string.h, not strings.h 1997-06-02 22:18:31 +00:00
Guido van Rossum 7929c6fe95 Make delimiter and separator static for K&R C. 1997-05-20 22:38:21 +00:00