[Python-checkins] r54285 - in python/trunk: Doc/lib/libsite.tex Lib/site.py Misc/NEWS
martin.v.loewis
python-checkins at python.org
Mon Mar 12 12:01:17 CET 2007
Author: martin.v.loewis
Date: Mon Mar 12 12:01:10 2007
New Revision: 54285
Modified:
python/trunk/Doc/lib/libsite.tex
python/trunk/Lib/site.py
python/trunk/Misc/NEWS
Log:
Patch #1677862: Require a space or tab after import in .pth files.
Modified: python/trunk/Doc/lib/libsite.tex
==============================================================================
--- python/trunk/Doc/lib/libsite.tex (original)
+++ python/trunk/Doc/lib/libsite.tex Mon Mar 12 12:01:10 2007
@@ -28,12 +28,17 @@
A path configuration file is a file whose name has the form
\file{\var{package}.pth} and exists in one of the four directories
-mentioned above; its contents are additional items (one
-per line) to be added to \code{sys.path}. Non-existing items are
-never added to \code{sys.path}, but no check is made that the item
-refers to a directory (rather than a file). No item is added to
-\code{sys.path} more than once. Blank lines and lines beginning with
-\code{\#} are skipped. Lines starting with \code{import} are executed.
+mentioned above; its contents are additional items (one per line) to
+be added to \code{sys.path}. Non-existing items are never added to
+\code{sys.path}, but no check is made that the item refers to a
+directory (rather than a file). No item is added to \code{sys.path}
+more than once. Blank lines and lines beginning with \code{\#} are
+skipped. Lines starting with \code{import} (followed by space or tab)
+are executed.
+
+\versionchanged[A space or tab is now required after the import
+keyword]{2.6}
+
\index{package}
\indexiii{path}{configuration}{file}
Modified: python/trunk/Lib/site.py
==============================================================================
--- python/trunk/Lib/site.py (original)
+++ python/trunk/Lib/site.py Mon Mar 12 12:01:10 2007
@@ -134,7 +134,7 @@
for line in f:
if line.startswith("#"):
continue
- if line.startswith("import"):
+ if line.startswith("import ") or line.startswith("import\t"):
exec line
continue
line = line.rstrip()
Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS (original)
+++ python/trunk/Misc/NEWS Mon Mar 12 12:01:10 2007
@@ -158,6 +158,8 @@
Library
-------
+- Patch #1677862: Require a space or tab after import in .pth files.
+
- Patch #1192590: Fix pdb's "ignore" and "condition" commands so they trap
the IndexError caused by passing in an invalid breakpoint number.
More information about the Python-checkins
mailing list