Ticket #8170 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Python Runner falls over with a path name with an apostrophe

Reported by: Samuel Jackson Owned by: Samuel Jackson
Priority: major Milestone: Release 3.0
Component: Framework Keywords:
Cc: Blocked By:
Blocking: Tester: Roman Tolchenov

Description (last modified by Samuel Jackson) (diff)

A user was reporting the following error when trying to run the ConvertToEnergy interface and selecting the OSIRIS instrument.

"Welcome to Mantid - Manipulation and Analysis Toolkit for Instrument Data
ParaView is not available
File "<Interface>", line 1
    import sys; sys.stdout = open('C:/Users/AlexO'M/AppData/Local/Temp/qt_temp.gq3868', 'w')
                                                
SyntaxError: invalid syntax"

It appears that the issue is caused by the fact that the user has an apostrophe in his home folder name. This caused the python runner to fall over because the string was not properly escaped.

Change History

comment:1 Changed 7 years ago by Samuel Jackson

  • Status changed from new to inprogress

Refs #8170 Escape quotes around path name for temp file

Changeset: 07f69d7888a20cb4e29d55b416e2f6c606268c2c

comment:2 Changed 7 years ago by Samuel Jackson

  • Status changed from inprogress to verify
  • Resolution set to fixed
  • Description modified (diff)

I checked that this change fixed the issue in Windows 8 (the OS the user was using) with the same folder name as reported by the user. I investigated the possibility of the user having a double quote in their path name but it appears to be a reserved character:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#file_and_directory_names

To Tester

I would suggest that to verify this you either rename your home folder to include an apostrophe or create a new user account, run a previous version Mantid and confirm you can reproduce the error. Then check the bugfix works.

comment:3 Changed 7 years ago by Roman Tolchenov

  • Status changed from verify to verifying
  • Tester set to Roman Tolchenov

comment:4 Changed 7 years ago by Roman Tolchenov

Tested by setting environment variable TMP to a path containing a single quote. A build before the fix fails and the one with the fix works.

It is possible for TMP to contain a double quote and it will break any interface. Opened ticket #8242 to have a thought about it.

comment:5 Changed 7 years ago by Roman Tolchenov

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/bugfix/8170_python_runner_bug'

Full changeset: 7582d89d9499c7bca7d7159f56cee315da27a237

comment:6 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9015

Note: See TracTickets for help on using tickets.