Commit Graph

111 Commits

Author SHA1 Message Date
Brett Cannon 0096e262ff Refactored site.py into functions. Also moved over to using sets.
New regression test suite.
2004-06-05 01:12:51 +00:00
Brett Cannon 46cf4fc249 Back out last patch that removed an entry from sys.path if it was not an
existent path.  Pointed out by jvr that entries could be non-file items for
custom importers.
2004-03-21 14:06:49 +00:00
Brett Cannon cc45466b8f Remove non-existent paths. 2004-03-20 21:31:33 +00:00
Brett Cannon 497331fa2b Fix how line endings were handled when iterating over a .pth file by stripping
all whitespace at the end of the path line.
2004-03-20 21:08:17 +00:00
Hye-Shik Chang 4a8d42f73f We have cp932 support in standard distribution now. And there's now
no major codepages unsupported by Python, so remove the eg. case.
2004-02-13 07:14:13 +00:00
Walter Dörwald 70a6b49821 Replace backticks with repr() or "%r"
From SF patch #852334.
2004-02-12 17:35:32 +00:00
Andrew MacIntyre 2e8a6e0ec6 To find the curses extension as a DLL (on OS/2), we need to adjust the
library search path to include the extension directory.  Without this,
the curses_panel extension can't find the curses extension/DLL, which
exports some curses symbols to it.
2003-12-02 12:27:25 +00:00
Walter Dörwald f0dfc7ac5c Fix a bunch of typos in documentation, docstrings and comments.
(From SF patch #810751)
2003-10-20 14:01:56 +00:00
Jeremy Hylton 6d58bf69ee Repair operator error. 2003-07-18 17:45:33 +00:00
Jeremy Hylton bdf3b509ed SF patch 773476: NameError when there are no prefixes. 2003-07-18 17:24:07 +00:00
Jack Jansen 470b0c0e1f In an OSX framework build Python could fail if HOME wasn't set, fixed.
Fixes #747954.
2003-06-03 10:55:35 +00:00
Martin v. Löwis a94568a753 Patch #734231: Update RiscOS support. In particular, correct
riscospath.extsep, and use os.extsep throughout.
2003-05-10 07:36:56 +00:00
Jack Jansen be5d707926 When on MacOSX, and only in a framework build, add
~/Library/Python/2.3/site-packages to sys.path, if it exists.
2003-04-16 13:12:21 +00:00
Martin v. Löwis 4eab486476 Patch #671666: Alias ANSI code page to "mbcs". 2003-03-03 09:34:01 +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
Tim Peters 230a60c6ec Whitespace normalization. 2002-11-09 05:08:07 +00:00
Marc-André Lemburg 7ccd30fa43 Fix a problem in site.py which triggers in case sys.path is empty.
Bugfix candidate for 2.2.2.
2002-09-19 11:11:27 +00:00
Fred Drake e80c0d3580 Add an XXX comment and a pointer to a full bug report. 2002-07-25 20:13:03 +00:00
Raymond Hettinger 54f0222547 SF 563203. Replaced 'has_key()' with 'in'. 2002-06-01 14:18:47 +00:00
Guido van Rossum 2e1c09c1fd Removed old Digital Creations copyright/license notices (with
permission from Paul Everitt).  Also removed a few other references to
Digital Creations and changed the remaining ones to Zope Corporation.
2002-04-04 17:52:50 +00:00
Andrew MacIntyre 5cef57131f OS/2 EMX port Library and regression test changes:
Lib/
    os.py
    os2emxpath.py   // added - OS/2 EMX specific path manipulation routines
    popen2.py
    site.py
  Lib/test/
    test_fcntl.py
    test_longexp.py
2002-02-24 05:32:32 +00:00
Neal Norwitz 34172d5316 SF #515020, delete global variables which are used only for temporary
values in for loops (dircase, prefix, sitedir).
2002-02-11 18:34:41 +00:00
Guido van Rossum facf24bdc7 Don't use Latex \code{...} in docstrings. 2001-12-17 16:07:06 +00:00
Barry Warsaw 6e1c576a4e Get rid of the stupid backslash in front of the column zero open
paren.  This was there to worm around a stupid XEmacs bug, but since I
can't tickle the bug in newer XEmacsen (just tried w/21.4.5) it's
possible the problem has been fixed.  We shouldn't have to be working
around editor bugs anyway.

If it crops up again, I'll report it (again) to the XEmacs crowd.
2001-12-17 15:40:24 +00:00
Guido van Rossum e2ae77b8b8 SF patch #474590 -- RISC OS support 2001-10-24 20:42:55 +00:00
Guido van Rossum e37e96df06 Correct the URL for the license (only used when the LICENSE[.txt] file
is not found).  Being fancy: insert the first 3 characters of
sys.version in the URL.
2001-10-02 18:27:09 +00:00
Martin v. Löwis 339d0f720e Patch #445762: Support --disable-unicode
- Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled
- check for Py_USING_UNICODE in all places that use Unicode functions
- disables unicode literals, and the builtin functions
- add the types.StringTypes list
- remove Unicode literals from most tests.
2001-08-17 18:39:25 +00:00
Just van Rossum ba634b2ec3 Rewrote Jack's latest change so it does what it intended to do... 2001-08-15 21:20:42 +00:00
Jack Jansen 31b5323c84 Don't remove non-directories from sys.path on the mac: files
can be on sys.path too.
2001-08-15 12:07:46 +00:00
Fred Drake 7f5296e7c0 Make the add*() helper functions more robust for use after intialization
is complete:  recompute _dirs_in_sys_path each time these functions are
entered after module initialization is complete, and reset before
returning to user code.

This closes SF patch #442983.
2001-07-20 20:06:17 +00:00
Guido van Rossum 27451d0fc8 Copying this 2.1.1 bugfix to the trunk:
Fix showstopper SF bug #442983: use of site.addsitedir() was broken
because it references the global dirs_in_sys_path which is deleted.
The fix avoids deleting that global.

(My email through python.org or digicool.com is non-functional at the
moment; use gvanrossum@home.com to reach me.)
2001-07-20 14:57:12 +00:00
Fred Drake fd4ff52c22 Actually remove directories from sys.path if they do not exist; the intent
is to avoid as many stat() calls as we can.
2001-07-12 21:08:33 +00:00
Tim Peters 6a479f5488 PEP 250: Add lib/site-packages to sys.path on Windows; also sys.prefix
to sys.path if os.sep == ':' (Macs?).  See PEP 250.
2001-07-12 05:20:13 +00:00
Fred Drake 1fb5ce0323 Avoid using os.path.normcase() on sys.path elements; doing so causes paths
to be presented in an unfamiliar case on case-preserving filesystems.

This closes SF patch #436173.
2001-07-02 16:55:42 +00:00
Guido van Rossum 83213cc0a0 Add new built-in 'help' which invokes pydoc.help (with a twist). 2001-06-12 16:48:52 +00:00
Barry Warsaw 62d248892f Two minor changes for better Jython compatibility. Finn Bock says:
Change 1: Not all 'modules' in sys.modules have a
    sensible __file__ attribute. Some of our java package
    can have the __file__ attribute set to None.

    Change 2: In jython we have the jython license file in
    <root> and the CPython license file in <root>/Lib. By
    reversing the search sequence jython will find and
    show the jython license file before the CPython file.

Closes SF patch #405853.
2001-03-23 17:53:49 +00:00
Guido van Rossum d74fb6b12a RISCOS changes by dschwertberger. 2001-03-02 06:43:49 +00:00
Guido van Rossum 48eb9cd62f A hack to augment sys.path with the build/lib.<platform> directory
created by Andrew's setup.py script, *if* we're actually running from
the build directory.  (The test for that: whether the sys.path[-1]
ends in "/Modules".)

This has one disadvantage: it imports a fair amount of code from the
distutils package, just in order to be able to calculate the correct
pathname.  See if I care. :-)
2001-01-19 21:54:59 +00:00
Martin v. Löwis bb0a4b7898 Patch #103134: Support import lines in pth files. 2001-01-11 13:02:43 +00:00
Jack Jansen d49056cd90 The ".pth" code knew about the layout of Python trees on unix and
windows, but not on the mac. Fixed.
2000-12-12 22:39:04 +00:00
Barry Warsaw 23f26ce813 Fix `credits' to credit the Jython developers when running under that
interpreter.  Update and reword the credits for CPython.  Closes SF
patch #102665.
2000-12-06 22:20:07 +00:00
Guido van Rossum f19a7ac220 Fix a few problems with the _Printer class and the license variable.
1. repr(license) will no longer print to stdout and read from stdin;
you have to use license().  `license` is a short message explaining
this.

2. Use lazy initialization so that startup isn't slowed down by the
search for the LICENSE file.

3. repr(license) actually returns the desired string, rather than
printing to stdout and returning ''.  (Why didn't we think of this
before?)

4. Use the pythonlabs license URL as the license fallback instead of
the CNRI license handle.
2000-10-03 17:11:37 +00:00
Fred Drake 38cb9f1f17 Convert all entries on sys.path to absolute paths, and also update the
__file__ attributes of already-imported modules to be absolute.  This helps
robustify the interpreter against os.chdir() calls from the application.

Only remove setdefaultencoding() from sys if it exists; if this module is
run as a script (since there is a _test() function that gets run), it broke
because the script attempts to remove it again after the import of site
has already done so.  This allows the module to be run as a script again.

makepath():  New function, standardizes all pathname normalization in one
             place.
2000-09-28 16:52:36 +00:00
Marc-André Lemburg 09cad08d75 sys.setdefaultencoding() should only be called in case the standard
default encoding ("ascii") is changed. This safes quite a few cycles
during startup since the first call to .setdefaultencoding() will
initialize the codec registry and the encodings package.

See python-dev for a discussion (Subject: "[Python-Dev] [comp.lang.python] sys.setdefaultencoding (2.0b1)").
2000-09-18 11:06:00 +00:00
Guido van Rossum d1252395bd Add new builtin commands "copyright", "license", "credits" which
display the information you would expect them to display.
2000-09-05 04:39:55 +00:00
Fredrik Lundh 3fded4bb29 -- fixed the comment, too 2000-07-15 20:58:44 +00:00
Fredrik Lundh efd7b001d6 -- note to self: wait until 'cvs commit' has finished before
you edit the file.
2000-07-15 20:50:27 +00:00
Fredrik Lundh 47ac12662a -- changed default encoding to "ascii". you can still change
the default via site.py...
2000-07-15 20:45:23 +00:00
Fredrik Lundh 663809ed83 -- removed get_default compatibility kludge
-- added a few extra comments to locale.py
2000-07-10 19:32:19 +00:00
Jeremy Hylton a05e293a21 typos fixed by Rob Hooft 2000-06-28 14:48:01 +00:00
Marc-André Lemburg 990bbe90d5 Marc-Andre Lemburg <mal@lemburg.com>:
Added support to set the default encoding of strings
at startup time to the values defined by the C locale.

The sys.setdefaultencoding() API is deleted after having
set up the encoding, so that user code cannot subsequentely
change the setting. This effectively means that only site.py
may alter the default setting.
2000-06-07 09:12:09 +00:00
Guido van Rossum e720176548 Wrong pathname in docstring detected by Fredrik Nehr. 1998-11-25 15:57:47 +00:00
Guido van Rossum d89fa0c576 Add built-in string variables 'quit' and 'exit' that display a hint on
how to exit (in a platform dependent way!).  We use os.sep to
determine which platform we're on, since I expect that this will work
better for minority platforms.
1998-08-07 18:01:14 +00:00
Guido van Rossum 45e2fbc2e7 Mass check-in after untabifying all files that need it. 1998-03-26 21:13:24 +00:00
Guido van Rossum 0d8fcb233e Update the doc string to emphasize non-Unix behavior earlier;
sys.prefix is no longer empty on any platform that I know of.
1998-01-13 18:32:40 +00:00
Guido van Rossum 62b297b698 Change packages -> site-packages 1997-09-08 02:14:09 +00:00
Guido van Rossum dc5d07d952 Different test for Unix -- rely on os.sep instead of sys.platform. 1997-09-03 23:12:18 +00:00
Guido van Rossum ad87d3e826 Give in to Mike Meyer -- add *both* lib/python1.5/packages and
lib/site-python to the path (if they exist).  This is a reasonable
compromise.
1997-09-03 21:41:30 +00:00
Guido van Rossum fc6efffbf9 #Removed debug print that was accidentally left in. 1997-09-03 00:35:38 +00:00
Guido van Rossum f30bec7bb2 New site.py semantics. Searches in
<*prefix>/lib/python<version>/packages for *.pth files containing
directories that are appended to sys.path.
1997-08-29 22:30:45 +00:00
Guido van Rossum e57c96ee4c site customization hook... 1996-08-17 19:56:26 +00:00