Skip to content

Error accessing PDF file installed in package doc folder #13886

Closed

Description

@zivankaraman

I'm having trouble accessing a PDF file that's installed in the package doc folder. For example, I'm trying to access the zoo.pdf file in the "C:\Program Files\R\R-4.2.3\library\zoo\doc" folder. When I open the package help page and click on "User guides, package vignettes and other documentation" and then click on the zoo::zoo link or the PDF link next to the description, my default browser opens and I get the error message "Access to 127.0.0.1 denied - HTTP ERROR 403". I've tried using different browsers, but the problem persists. However, I can access the file from Windows Explorer. If I click on the "Show in new window" icon at the top of the Help pane and select the same file, everything works perfectly fine. The file also opens correctly from vanilla R (going through help.start() etc.).

System details

RStudio Edition : Desktop
RStudio Version : 2023.09.1+494
OS Version      : Windows 10
R Version       : 4.2.3

RStudio information:
RStudio 2023.09.1+494 "Desert Sunflower" Release (cd7011d, 2023-10-16) for windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2023.09.1+494 Chrome/116.0.5845.190 Electron/26.2.4 Safari/537.36

R sessionInfo:
R version 4.2.3 (2023-03-15 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)
Matrix products: default
locale:
[1] LC_COLLATE=French_France.utf8 LC_CTYPE=French_France.utf8 LC_MONETARY=French_France.utf8 LC_NUMERIC=C
[5] LC_TIME=French_France.utf8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.2.3 tools_4.2.3

Steps to reproduce the problem

  1. Open the "zoo" package help page.
  2. Click on "User guides, package vignettes and other documentation".
  3. Click on the zoo::zoo link or the PDF link next to the description.

Describe the problem in detail

The default browser opens and the error message "Access to 127.0.0.1 denied - HTTP ERROR 403" is displayed.

Describe the behavior you expected

I would expect the PDF file to open in the browser (or be proposed to download as in vanilla R.

  • [x ] I have read the guide for submitting good bug reports.
  • [ x] I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • [ x] If I am reporting an RStudio crash, I have included a diagnostics report.
  • [ x] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. added
    new
    on Nov 2, 2023
  2. kevinushey commented on Nov 2, 2023

    @kevinushey
    Collaborator

    Thanks for the bug report! I believe this has been fixed in the latest daily builds -- would you be able to test and report back?

  3. zivankaraman commented on Nov 3, 2023

    @zivankaraman
    Author

    It indeed works now for the PDF files that are vignettes, but not in the general case.

    RStudio information:
    RStudio 2023.12.0-daily+260 "Ocean Storm" Daily (d4a6222, 2023-11-02) for windows
    Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2023.12.0-daily+260 Chrome/116.0.5845.190 Electron/26.2.4 Safari/537.36

    Steps to reproduce the problem

    1. Create a new R project in RStudio of type "R package", and call it "hello".
    2. Create an "inst/doc" folder in the package root folder.
    3. Copy any PDF file to that folder, for reproducibility I used R-lang.pdf.
    4. Build and install the "hello" package.
    5. Open the package help and click on "User guides, package vignettes and other documentation" and then click on the "R-lang.pdf" link.
    6. The error message "vignette ‘R-lang’ not found" is shown in the R console.
    7. However, the file "R-lang.pdf" is present in the doc folder of the installed 'hello' package. It is the only file in that folder.
  4. kevinushey commented on Nov 3, 2023

    @kevinushey
    Collaborator

    Thanks; I'll take a look.

  5. added this to the Ocean Storm milestone on Nov 6, 2023
  6. kevinushey commented on Nov 6, 2023

    @kevinushey
    Collaborator

    This should be fixed in the latest daily builds; would you be willing to test once more?

  7. self-assigned this
    on Nov 6, 2023
  8. removed
    new
    on Nov 6, 2023
  9. zivankaraman commented on Nov 7, 2023

    @zivankaraman
    Author

    It works, but only if the file doesn't have spaces in the name. If you rename "R-lang.pdf" to "R lang.pdf" you still get the error message:

    Error: vignette ‘R%20lang’ not found

  10. jonvanausdeln commented on Nov 13, 2023

    @jonvanausdeln

    I just checked with 2023.12.0-daily+278 on Windows11 and as @zivankaraman mentioned, it fails with a filename containing spaces. It also fails for files with non-ascii file names, such as 東京.pdf. This could be related to #12467

  11. kevinushey commented on Nov 14, 2023

    @kevinushey
    Collaborator

    Thanks @jonvanausdeln: I've decided to side-step the issue in Electron altogether and just use our own native code to open the file on Windows. Hopefully this will resolve the issue once and for all.

  12. jonvanausdeln commented on Nov 16, 2023

    @jonvanausdeln

    Checked again with 2023.12.0-daily+290
    Windows 11

    Now works with spaces and Unicode characters in file name.. e.g. 東京 with a space.pdf

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions