Ticket #7646 (closed: invalid)

Opened 7 years ago

Last modified 5 years ago

RunPythonScript.py algorithm line ending issue

Reported by: Owen Arnold Owned by: Martyn Gigg
Priority: critical Milestone: Release 3.0
Component: Framework Keywords:
Cc: Blocked By:
Blocking: Tester: Owen Arnold

Description

The algorithm does not convert the input code to unix line endings before executing the code. python exec, seems to require that the line endings are unix style. A quick attempt of replacing

code = self.getPropertyValue("Code")

with

code = self.getPropertyValue("Code")
code = code.replace('\r', '')

fixed the issue on my mac.

Change History

comment:1 Changed 7 years ago by Martyn Gigg

  • Status changed from new to verify
  • Resolution set to invalid

Ticket #7019 has seen RunPythonScript become a C++ algorithm. The line-ending issue has been resolved during that transition. Once that ticket has been tested this can be tested too but no code should need to be merged.

This will need to be tested on either Mac or Windows as Linux will only ever see LF line endings.

To test: This is most easily tested through the StartLiveData algorithm by selecting a script as part of the post processing. Paste in some code from an external editor and then add some other code in the editor itself and try to execute it. It should execute okay now.

comment:2 Changed 7 years ago by Russell Taylor

  • Status changed from verify to verifying
  • Tester set to Russell Taylor

comment:3 Changed 7 years ago by Russell Taylor

  • Status changed from verifying to verify
  • Tester Russell Taylor deleted

I've no reason to doubt that this works OK now, but I wasn't able to reproduce any error with a pre-#7019 build either on Mac or Windows. Probably Owen should test this.

comment:4 Changed 7 years ago by Owen Arnold

  • Status changed from verify to verifying
  • Tester set to Owen Arnold

comment:5 Changed 7 years ago by Owen Arnold

  • Status changed from verifying to closed

I couldn't reproduce this on an old version of mantid, and it does not affect the current one.

comment:6 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8491

Note: See TracTickets for help on using tickets.