From: Brett Cannon Date: Sat, 20 Mar 2004 21:14:25 +0000 (+0000) Subject: Strip all whitespace at the end of a line when validating paths specified in X-Git-Tag: v2.3.4c1~105 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6fa7c0c16a7c7ed9c9a67c6d3e1e516f0665716c;p=thirdparty%2FPython%2Fcpython.git Strip all whitespace at the end of a line when validating paths specified in a .pth file. Fixes bug #700055 . --- diff --git a/Lib/site.py b/Lib/site.py index 7282190eee59..49cf8fa4322c 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -148,8 +148,7 @@ def addpackage(sitedir, name): if dir.startswith("import"): exec dir continue - if dir[-1] == '\n': - dir = dir[:-1] + dir = dir.rstrip() dir, dircase = makepath(sitedir, dir) if not dircase in _dirs_in_sys_path and os.path.exists(dir): sys.path.append(dir)