Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows online help broken when spaces in TEMP environ #47295

Closed
peta mannequin opened this issue Jun 6, 2008 · 4 comments
Closed

Windows online help broken when spaces in TEMP environ #47295

peta mannequin opened this issue Jun 6, 2008 · 4 comments
Labels
OS-windows stdlib Python modules in the Lib dir

Comments

@peta
Copy link
Mannequin

peta mannequin commented Jun 6, 2008

BPO 3045
Nosy @birkenfeld, @orsenthil
Files
  • issue3045-py26.diff
  • issue3045-py3k.diff
  • 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 = None
    closed_at = <Date 2008-07-16.21:19:37.655>
    created_at = <Date 2008-06-06.03:10:28.374>
    labels = ['library', 'OS-windows']
    title = 'Windows online help broken when spaces in TEMP environ'
    updated_at = <Date 2008-07-16.21:19:37.653>
    user = 'https://bugs.python.org/peta'

    bugs.python.org fields:

    activity = <Date 2008-07-16.21:19:37.653>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2008-07-16.21:19:37.655>
    closer = 'georg.brandl'
    components = ['Library (Lib)', 'Windows']
    creation = <Date 2008-06-06.03:10:28.374>
    creator = 'peta'
    dependencies = []
    files = ['10850', '10851']
    hgrepos = []
    issue_num = 3045
    keywords = ['patch']
    message_count = 4.0
    messages = ['67746', '68619', '69413', '69838']
    nosy_count = 3.0
    nosy_names = ['georg.brandl', 'orsenthil', 'peta']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue3045'
    versions = ['Python 2.6', 'Python 3.0']

    @peta
    Copy link
    Mannequin Author

    peta mannequin commented 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

    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?

    @peta peta mannequin added stdlib Python modules in the Lib dir OS-windows labels Jun 6, 2008
    @orsenthil
    Copy link
    Member

    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
    Copy link
    Member

    This is a really quick fix. Someone with tracker admin access can apply
    the patches and close this.
    [Applies to py26 and py3k]

    @birkenfeld
    Copy link
    Member

    Fixed in r65035.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    OS-windows stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants