Repository navigation
Copy code to temporary file during Source as Local Job - #7871
Conversation
|
I'm not sure about this approach. Some R scripts use the name and/or path of the currently executing script to compute resource paths, etc. Executing the script from a temporary file (even though the working directory is the same) may break some scripts. It looks like we correctly convert to the system encoding when creating the command that invokes the job, so maybe all we need is to decode correctly here? |
|
@jmcphers I'm not exactly sure what you mean. Are you suggesting we decode from the system encoding to utf8 before parsing the file? In that case, do we need to encode the path when creating the command? |
e6639ad to
b1bc4bb
Compare
|
I updated the code to remove the second |
jmcphers
left a comment
There was a problem hiding this comment.
LGTM, glad this turned out to be simple!
|
Also deserves a NEWS entry (feel free to update on master) |
Done! |
Intent
Fixes #6701
Source as Local Jobwas failing on Windows when the file's path had a non ASCII character in it on Windows. This PR executes the source as it does on other operating systems today.Approach
Rather than attempting to source from the file the user is working in, copy the contents of that file to a temporary file. This avoids us needing to encode and re-encode files paths.
QA Notes
The original ticket gives a good repro. We should also make sure functionality hasn't regressed on other OSes. We should also ensure that non-ascii encoded characters run without issue (they may produce a warning which is ok).