Re: [R] Error when calling (R 4.0.x on Windows) from Python

2021-02-02 Thread Bill Dunlap
R/Rterm now has shell-independent ways to specify its standard input file, --file=file.R, and environment variables, VAR=VALUE. Should it also have shell-independent arguments to specify files to contain stdout and stderr or both? Then its help message could omit the '> output' (it can already le

Re: [R] Error when calling (R 4.0.x on Windows) from Python

2021-02-02 Thread Tomas Kalibera
A reproducible example: system("\"C:\\Program Files\\R\\R-4.0.3\\bin\\R.exe\" -e commandArgs() >out")  # does not create "out" system("\"C:\\Program Files\\R\\R-3.6.3\\bin\\R.exe\" -e commandArgs() >out")  # creates "out" Note that this does not create "out", either: system("\"C:\\Program Fi

Re: [R] Error when calling (R 4.0.x on Windows) from Python

2021-01-29 Thread Duncan Murdoch
On 29/01/2021 3:57 a.m., Marcel Baumgartner wrote: Dear Bill, Duncan and Martin, thanks for your investigation. Can you clarify on next steps? Is this now an official bug, or have you found a workaround? For your information: the issue showed up the first time when I called R 4.0.2 from withi

Re: [R] Error when calling (R 4.0.x on Windows) from Python

2021-01-29 Thread Marcel Baumgartner
Dear Bill, Duncan and Martin, thanks for your investigation. Can you clarify on next steps? Is this now an official bug, or have you found a workaround? For your information: the issue showed up the first time when I called R 4.0.2 from within a software called "IDEA" (from Caseware Analytics), us

Re: [R] Error when calling (R 4.0.x on Windows) from Python

2021-01-27 Thread Bill Dunlap
I tried the following change, that adds quotes if the argument does not include ">". Index: front-ends/rcmdfn.c === --- front-ends/rcmdfn.c (revision 79883) +++ front-ends/rcmdfn.c (working copy) @@ -173,9 +173,13 @@ fp

Re: [R] Error when calling (R 4.0.x on Windows) from Python

2021-01-27 Thread Duncan Murdoch
On 27/01/2021 3:40 p.m., Bill Dunlap wrote: I believe the problem is from svn 77925 in gnuwin/front-ends/rcmdfn.c, which was committed a few days after 3.6.3 was released. Rterm used to put double quotes around a command line argument only if it contained a space, now it double quotes all argume

Re: [R] Error when calling (R 4.0.x on Windows) from Python

2021-01-27 Thread Bill Dunlap
I believe the problem is from svn 77925 in gnuwin/front-ends/rcmdfn.c, which was committed a few days after 3.6.3 was released. Rterm used to put double quotes around a command line argument only if it contained a space, now it double quotes all arguments. It sees shell constructs like "1>" and t

Re: [R] Error when calling (R 4.0.x on Windows) from Python

2021-01-27 Thread Duncan Murdoch
On 27/01/2021 3:17 p.m., Duncan Murdoch wrote: On 27/01/2021 3:38 a.m., Martin Maechler wrote: Martin Maechler on Tue, 26 Jan 2021 12:37:58 +0100 writes: Marcel Baumgartner on Tue, 26 Jan 2021 08:55:48 +0100 writes: >> Dear all, my colleague posted our issue on stackoverfl

Re: [R] Error when calling (R 4.0.x on Windows) from Python

2021-01-27 Thread Duncan Murdoch
On 27/01/2021 3:38 a.m., Martin Maechler wrote: Martin Maechler on Tue, 26 Jan 2021 12:37:58 +0100 writes: Marcel Baumgartner on Tue, 26 Jan 2021 08:55:48 +0100 writes: >> Dear all, my colleague posted our issue on stackoverflow: >> Calling R script from Python does not

Re: [R] Error when calling (R 4.0.x on Windows) from Python

2021-01-27 Thread Bill Dunlap
I mistyped, 3.6.3 omits "1>", "log.txt" (not arguments.txt"), etc. My test was run in C:\tmp and used -e instead of -f and bin/R.exe instead of bin/x64/R.exe, using the following python script: import subprocess cmd363 = " ".join(["C:/R/R-3.6.3/bin/R.exe", "--vanilla", "--quiet", # "-f"

Re: [R] Error when calling (R 4.0.x on Windows) from Python

2021-01-27 Thread Bill Dunlap
Note that in R-3.6.3 commandArgs() does not include the arguments intended to be processed by the shell, "1>", "arguments.txt", etc., but in R-4.0.3 it does include them. It is as though an R shell() command was replaced by a system() command so cmd.exe didn't get a chance to process the command l

Re: [R] Error when calling (R 4.0.x on Windows) from Python

2021-01-27 Thread Martin Maechler
> Martin Maechler > on Tue, 26 Jan 2021 12:37:58 +0100 writes: > Marcel Baumgartner > on Tue, 26 Jan 2021 08:55:48 +0100 writes: >> Dear all, my colleague posted our issue on stackoverflow: >> Calling R script from Python does not save log file in >> version