You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows online help broken when spaces in TEMP environ #47295
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2008-07-16.21:19:37.655>created_at=<Date2008-06-06.03:10:28.374>labels= ['library', 'OS-windows']
title='Windows online help broken when spaces in TEMP environ'updated_at=<Date2008-07-16.21:19:37.653>user='https://bugs.python.org/peta'
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.
Activity
peta commentedon Jun 6, 2008
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
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:
which in windows ends up as os.system('more < FILE WITH SPACES'). The
filename should be quoted, e.g.
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?
orsenthil commentedon Jun 23, 2008
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.
orsenthil commentedon Jul 8, 2008
This is a really quick fix. Someone with tracker admin access can apply
the patches and close this.
[Applies to py26 and py3k]
birkenfeld commentedon Jul 16, 2008
Fixed in r65035.