Skip to content
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

parse_datetime crashes R session when providing invalid format specification #1182

Closed
meowcat opened this issue Mar 1, 2021 · 1 comment
Closed

Comments

@meowcat
Copy link

meowcat commented Mar 1, 2021

Brief description of the problem

library(readr)

example("parse_datetime") # works correctly

date_chr <- "11/26/2019 8:14:41 PM"
parse_datetime(date_chr, "%m/%d/%Y %h:%M:%s %p")

This results in a crash of the R session. Of course it should be %H:%M:%S but it seems unnecessarily harsh to crash the entire session because of this. I originally had %h:%m:%s however the duplicate %m was not the cause.

sessionInfo:

R version 4.0.4 (2021-02-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] readr_1.4.0

loaded via a namespace (and not attached):
 [1] compiler_4.0.4  magrittr_2.0.1  ellipsis_0.3.1  R6_2.5.0       
 [5] hms_1.0.0       tools_4.0.4     pillar_1.4.7    tibble_3.0.6   
 [9] crayon_1.4.1    vctrs_0.3.6     lifecycle_1.0.0 pkgconfig_2.0.3
[13] rlang_0.4.10
@jimhester
Copy link
Collaborator

This is a duplicate of #1151, it is already fixed by 97186a8 in the development version of readr, but those changes are not currently on CRAN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants