-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Escape reserved path characters in the remote images post-transform #12253
Escape reserved path characters in the remote images post-transform #12253
Conversation
Perhaps this isn't ideal, particularly because it would affect the on-disk image download storage layout for non-Windows hosts. In particular: for hosts that had previously successfully image downloads in a |
I've adjusted the logic to retain the colon symbol on POSIX systems, meaning that cache re-use should be possible there. Existing cached content will not have existed on Windows systems for these URLs, because the directory names would have been considered invalid and not created in the first place. I still think we should consider replacing this logic entirely with |
I've added all of the reserved characters from https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file. This may be overkill, but better safe than sorry. A |
Thanks @AA-Turner. One thing I am slightly concerned about is that the For long filenames, that's avoided due to the use of a I'd figured that perhaps adding colon-only, and only on Windows (where it hadn't been previously supported) would be a cautious improvement here -- but also that it could make sense to try to solve the problem more comprehensively in the not-too-distant future by using a well-tested library to handle all of this for us. (you may already have understood / inferred all that, but I'd like to make sure) |
We could simply always use the A |
Ok, yep - it looks like I misunderstood some of the code; the In that case, I think we should indeed always use Does that seem safe and reasonable? (I'm not completely confident myself yet, this is relatively new code to me) |
…nsform (sphinx-doc#12253)" This reverts commit e1d5235.
Feature or Bugfix
Purpose
Detail
:
) to the dictionary of character-to-path mappings in theImageDownloader
class; it isn't considered a valid path component character on Windows, meaning that attempts to create directories that include it in the name fail.Relates