From: Georg Brandl Date: Wed, 16 Jul 2008 21:19:28 +0000 (+0000) Subject: #3045: fix pydoc behavior for TEMP path with spaces. X-Git-Tag: v2.6b2~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b32dea5a3eb0c008d00de3a42b1aa0c05bad2d13;p=thirdparty%2FPython%2Fcpython.git #3045: fix pydoc behavior for TEMP path with spaces. --- diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 2035f7889ee4..7681a3206a62 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1333,7 +1333,7 @@ def getpager(): (fd, filename) = tempfile.mkstemp() os.close(fd) try: - if hasattr(os, 'system') and os.system('more %s' % filename) == 0: + if hasattr(os, 'system') and os.system('more "%s"' % filename) == 0: return lambda text: pipepager(text, 'more') else: return ttypager @@ -1361,7 +1361,7 @@ def tempfilepager(text, cmd): file.write(text) file.close() try: - os.system(cmd + ' ' + filename) + os.system(cmd + ' "' + filename + '"') finally: os.unlink(filename)