Bug 495839 - Cannot open file in path like "D:\#Temp\#Share\test.pdf"
Summary: Cannot open file in path like "D:\#Temp\#Share\test.pdf"
Status: CONFIRMED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 23.08.1
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-05 13:34 UTC by xlleon
Modified: 2024-11-22 14:06 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
reproduce step 1 (18.10 KB, image/png)
2024-11-22 07:15 UTC, xlleon
Details
reproduce step 2 (1.88 MB, image/png)
2024-11-22 07:16 UTC, xlleon
Details
reproduce step 3 (795.45 KB, image/png)
2024-11-22 07:17 UTC, xlleon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description xlleon 2024-11-05 13:34:17 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***

SUMMARY
When open a pdf file "D:\#Temp\#Share\test.pdf", it does not open the file. Instead, it opens the folder "D:\#Temp\"

STEPS TO REPRODUCE
- Same as summary

OBSERVED RESULT
- Same as summary

EXPECTED RESULT
- Same as summary

SOFTWARE/OS VERSIONS
Windows: 

ADDITIONAL INFORMATION
Comment 1 Will Sierzputowski 2024-11-21 18:57:19 UTC
Thank you for reporting, but this is unclear and there is not enough information to try to replicate this behavior. 

Can you describe how you are trying to open this file (file->open, is okualr registered to open PDFs through windows, etc). You say that it opens a folder. What opens a folder? Is okular somehow displaying the directory, or is windows explorer opening a view at the location? Are you able to open the PDF in question if it is in a different location, like your Desktop?
Comment 2 xlleon 2024-11-22 07:15:21 UTC
It is easy to reproduce:
1. Create a folder with "#" in its name, put a pdf file and two image files in it. From example, I have D:\#test\ folder, 1 pdf and 2 pictures in it (attached 1.png).
2. Open the pdf file with okular, I use "open with" from windows right click pop-up menu.
3. Okular does not open the pdf, but show the 2 picture file (attached 2.png). 
4. You can the open history from attached 3.png
Comment 3 xlleon 2024-11-22 07:15:59 UTC
Created attachment 176032 [details]
reproduce step 1
Comment 4 xlleon 2024-11-22 07:16:36 UTC
Created attachment 176033 [details]
reproduce step 2
Comment 5 xlleon 2024-11-22 07:17:00 UTC
Created attachment 176034 [details]
reproduce step 3
Comment 6 Will Sierzputowski 2024-11-22 14:06:05 UTC
Thanks for the steps. I can duplicate this behavior on Windows 11 (Okular 24.11.80). 

I will have to look more into what could cause this, but here is a summary of what I tested.

- I can only cause this behavior when the file is opened through Windows explorer with 'Right Click->Open With->Okular'. It does not happen when the file is opened from inside of Okular(File->open) and does not happen when the file is opened by dragging the PDF into an already running Okular instance. A short-term solution would be opening the file in one of these other ways.

- If only happens when the folder has a ‘#’ in the first position, or when ‘.#’ are the first two positions. Names such as 't#est\test.pdf' work correctly. 

- This happens when opened from the commands line too ‘okular.exe test.pdf’ if the above regarding ‘#’ is true about the file directory. This also happens when the file is hard linked i.e. ‘okular.exe D:\#test\test.pdf’. 

- The same behavior occurs if Okular is invoked with path to the directory the PDF file is in. ‘okular.exe D:\#test’. This works with out without # and I believe is intended behavior

My tentative conclusion is this is an issue with parsing the command line parameter (Windows invokes the call for ‘open with’ through command line parameters) which causes the PDF file to be ignored when the directory starts with #. When I look more into it, I will see if the issue Windows only or also persists on a Linux system.