Bug 16311 - It would be nice if system2 could generally set environment variables from env argument
Summary: It would be nice if system2 could generally set environment variables from en...
Status: NEW
Alias: None
Product: R
Classification: Unclassified
Component: I/O (show other bugs)
Version: R 3.1.2
Hardware: x86_64/x64/amd64 (64-bit) Windows 64-bit
: P5 enhancement
Assignee: R-core
URL:
Depends on:
Blocks:
 
Reported: 2015-04-14 18:30 UTC by Mikhail Titov
Modified: 2015-04-14 19:55 UTC (History)
0 users

See Also:


Attachments
sample showing the problem, requires testthat, but can be easily altered (558 bytes, text/plain)
2015-04-14 18:30 UTC, Mikhail Titov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Titov 2015-04-14 18:30:16 UTC
Created attachment 1791 [details]
sample showing the problem, requires testthat, but can be easily altered

system2() does not set environment variables properly (at least, other not tested) on Windows OS. While documentation is somewhat vague regarding *env* argument. I tried named character vector and just a character vector with name=value pairs with same result. Using Sys.setenv() works as expected. Sample R script is attached.
Comment 1 Mikhail Titov 2015-04-14 18:33:42 UTC
I failed to mention the R version as there was no such in a drop down box.
> R.version
               _                           
platform       i386-w64-mingw32            
arch           i386                        
os             mingw32                     
system         i386, mingw32               
status                                     
major          3                           
minor          1.3                         
year           2015                        
month          03                          
day            09                          
svn rev        67962                       
language       R                           
version.string R version 3.1.3 (2015-03-09)
nickname       Smooth Sidewalk
Comment 2 Mikhail Titov 2015-04-14 19:55:49 UTC
Apparently I missed the note in docs mentioning the limitation on Windows. So I change this to "enhancement". It would be handy, e.g. to run python scripts with non-standard installations requiring setting PYTHONHOME, PATH and such.