Skip to content

Commit

Permalink
Don't overwrite the persistent variable when hacking paths
Browse files Browse the repository at this point in the history
Add some comments explaining the situtation as best I know.
See Issue #1182.  Fixes [2].

[2] https://savannah.gnu.org/bugs/index.php?65735
  • Loading branch information
cbm755 committed May 13, 2024
1 parent d082fd2 commit 6eee88d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions inst/private/python_ipc_system.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6eee88d

Please sign in to comment.