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

'help' Fails on Windows: "Invalid Argument" to 'file.create' #223

Closed
GregYannes opened this issue Jul 30, 2021 · 6 comments · Fixed by #224
Closed

'help' Fails on Windows: "Invalid Argument" to 'file.create' #223

GregYannes opened this issue Jul 30, 2021 · 6 comments · Fixed by #224
Assignees

Comments

@GregYannes
Copy link

GregYannes commented Jul 30, 2021

Hello! I believe there is an issue specific to Windows, when using box::help() to view the interactive "Help" window in RStudio.

While box::help() worked just fine on my Mac (Mojave), I got this warning on Windows (10 Enterprise)

Warning messages:
1: In utils::packageDescription(package, fields = "Version") :
  no package 'PKG' was found
2: In file.create(to[okay]) :
  cannot create file 'C:\Users\greg\AppData\Local\Temp\RtmpYBTTyG/.R/doc/html/module:Resources/Modules/time.html', reason 'Invalid argument'

along with a URL not found message in an otherwise blank "Help" window.

I suspect the issue lies in the .../module:Resources/... component, which contains a : that is illegal for directory names on Windows. When I try file.create() on Windows with a similarly illegal filepath, I replicate this warning: cannot create file and reason 'Invalid argument'.

Unless I am much mistaken, line 87 of help.R is the culprit:

display_help(doc, paste0('module:', mod_name), help_type)
#                               ^
#                             Here
@klmr klmr self-assigned this Jul 30, 2021
@klmr
Copy link
Owner

klmr commented Jul 30, 2021

Working on a fix.

In the meantime, as a workaround in the R terminal you can use

box::help(your$topic, help_type = 'text')

This will display text help instead of HTML help.

Unfortunately the same doesn’t seem to work in RStudio (at least in my version, 1.3.1093), due to a bug in RStudio (unrelated to ‘box’).

@klmr
Copy link
Owner

klmr commented Jul 30, 2021

Oh that’s weird, that’s definitely not how it’s supposed to look. Here’s what this looks like for me (Windows 10):

Screenshot 2021-07-30 at 18 22 07

@GregYannes
Copy link
Author

GregYannes commented Jul 30, 2021

Ooops, my bad! I completely overlooked your warning

Unfortunately the same doesn’t seem to work in RStudio (at least in my version, 1.3.1093), due to a bug in RStudio (unrelated to ‘box’).

and my weird output was from RStudio. I will delete my comment accordingly.

@GregYannes
Copy link
Author

GregYannes commented Jul 30, 2021

My apologies for the confusion about text help, by the way. And thank you for elaborating with your answer on Stack Overflow!

@klmr
Copy link
Owner

klmr commented Jul 30, 2021

The error should hopefully be fixed now. Before the next CRAN update I’m still working on two other features but you can already install the new version. Either from source by following the source installation instructions in the README; or by downloading the compiled package below, and executing

install.packages('path/to/box_1.0.2.9000.zip', repos = NULL)

📦 box_1.0.2.9000.zip

@GregYannes
Copy link
Author

GregYannes commented Jul 31, 2021

Awesome, I can't wait to test it out!

Thanks again, Konrad! I truly appreciate your accessibility and responsiveness*, and I look forward to taking our team to the next level with the new and improved box. :)

* It's worth noting that our Head of Software Development was equally impressed.

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

Successfully merging a pull request may close this issue.

2 participants