-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: Set lazy = FALSE
by default on Windows?
#1266
Comments
I'm not 100% sure but suspect this issue that would be fixed in this suggestion is the same that caused tests to fail on GitHub Actions on 2 of my packages. The fix implemented (credit: @agila5 ) there was to add the following lines before using # Set the local edition for readr.
# See https://github.com/ropensci/stats19/issues/205
if (.Platform$OS.type == "windows" && utils::packageVersion("readr") >= "2.0.0") {
readr::local_edition(1)
} I think an upstream fix would be ideal to prevent others being affected by this platform-specific and potentially hard to diagnose issue so big 👍 on the suggestion. |
Commits that stopped |
Why did you not just put |
I was unaware of this solution. The solution was a suggestion form Andrea and it fixed the failing actions so I merged it: ropensci/stats19#206 Do you think updating the relevant section would be better? Happy to update the code in both packages if so if an upstream fix on the Are you considering implementing Christopher's suggestion? |
This is a similar suggestion but instead of having |
@andoomcz you can currently use the unexported |
I am often finding that readr is locking files. After reading a file in R and editing the file I find I cannot save the file again: "Error: Cannot open file for writing". How do I close the file connection and unlock the file so it can be overwritten? |
Either use |
@jimhester Thanks. What are the arguments for Do you have any ideas for making this more seamless? Would it be possible to catch the file lock error and retry after calling |
You should just use |
After the file is locked it is too late to set
|
@natbprice if using |
I added a |
Thanks for adding the new option! Really appreciate your help. |
Thank you @jimhester! The |
Hello!
The new speed is great with version 2.0.0. Thank you guys for all you do for the R community.
I've noticed across a few command checks unexpected issues with using
readr
, especially with tempfiles on Windows. For example, PL94171, which we are submitting an update usinglazy = FALSE
. We see a similar issue within theredist
package where a tempfile is written and can't be overwritten once opened withreadr
. (That particular test is skipped on CRAN because it's time consuming.)After some looking around, I found that this is explained and expected, see the readr 2.0.0 post
I was wondering if you would ever consider setting
lazy = FALSE
by default if it's a Windows machine. One approach could be a simple function, like the following:Then the default for
lazy
would belazy = !is_windows()
I understand if this type of change could cause other concerns, so feel free to disregard it.
Thanks,
Chris
This is loosely related to #1263.
The text was updated successfully, but these errors were encountered: