From 6eee88d281f5246e54d7e886a058de734329aa87 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Mon, 13 May 2024 15:56:57 -0700 Subject: [PATCH] Don't overwrite the persistent variable when hacking paths Add some comments explaining the situtation as best I know. See Issue #1182. Fixes [2]. [2] https://savannah.gnu.org/bugs/index.php?65735 --- inst/private/python_ipc_system.m | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/inst/private/python_ipc_system.m b/inst/private/python_ipc_system.m index 66104d69..7ee69451 100644 --- a/inst/private/python_ipc_system.m +++ b/inst/private/python_ipc_system.m @@ -133,10 +133,18 @@ tmpfilename, fd); end + % On Windows, tmp file is like C:\Users\Zoe\AppData\Local\Temp\oct-rZDdea + % and this causes issues for msys2 [1]. It seems the same files are available + % in /tmp/ (?) and cygpath translates them, but careful not to change the + % persistent variable [2]. + % [1] https://github.com/gnu-octave/symbolic/issues/1182 + % [2] https://savannah.gnu.org/bugs/index.php?65735 if python_env_is_cygwin_like (pyexec) - tmpfilename = cygpath (tmpfilename); + _tmpfilename = cygpath (tmpfilename); + else + _tmpfilename = tmpfilename; end - [status, out] = system ([pyexec ' ' tmpfilename]); + [status, out] = system ([pyexec ' ' _tmpfilename]); end info.raw = out;