This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Windows online help broken when spaces in TEMP environ
Type: Stage:
Components: Library (Lib), Windows Versions: Python 3.0, Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, orsenthil, peta
Priority: normal Keywords: patch

Created on 2008-06-06 03:10 by peta, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue3045-py26.diff orsenthil, 2008-07-08 04:32
issue3045-py3k.diff orsenthil, 2008-07-08 04:33
Messages (4)
msg67746 - (view) Author: Peter Whaite (peta) Date: 2008-06-06 03:10
If the environ vars TEMP or TMP contain spaces on w32 the on-line help
will not work.  e.g. help('or') gives the message

    The system cannot find the file specified.

This is because pydoc.tempfilepager sets filename=tempfile.mktemp()
which will have spaces in it if TEMP does.  The filename is then used to
constuct the system command:

     os.system(cmd + ' ' + filename)

which in windows ends up as  os.system('more < FILE WITH SPACES').  The
filename should be quoted, e.g.

     os.system('%s "%s"' % (cmd,filename))

I only ran across this problem because I use uwin on windows and it sets
TEMP to a w32 style long path.  The normal windows command shell uses
the dos spaceless sort form for the TMP and TEMP env vars so the problem
doesn't arise when python is invoked from there.

And isn't tempfile.mktemp() deprecated?
msg68619 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2008-06-23 09:56
This issue is valid in Python2.5. I verified it on a Windows. The fix
suggested 

Changing:
     os.system(cmd + ' ' + filename)
to
     os.system('%s "%s"' % (cmd,filename))

in pydoc.tempfilepager also makes sense for fixing this issue.
msg69413 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2008-07-08 04:32
This is a really quick fix. Someone with tracker admin access can apply
the patches and close this.
[Applies to py26 and py3k]
msg69838 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-07-16 21:19
Fixed in r65035.
History
Date User Action Args
2022-04-11 14:56:35adminsetgithub: 47295
2008-07-16 21:19:37georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg69838
nosy: + georg.brandl
2008-07-08 04:33:10orsenthilsetfiles: + issue3045-py3k.diff
2008-07-08 04:32:54orsenthilsetfiles: + issue3045-py26.diff
keywords: + patch
messages: + msg69413
versions: + Python 2.6, Python 3.0, - Python 2.5
2008-06-23 09:56:55orsenthilsetnosy: + orsenthil
messages: + msg68619
2008-06-06 03:10:28petacreate