fix(windows): convert back-slashes to forward-slashes for Windows #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1. Summary
Pelican Stork search doesn’t work correctly on my Windows if
OUTPUT_PATH
setting is custom.After fixing I can successfully use Pelican Stork search:
2. MCVE files
You can see this MCVE configuration on the
KiraPelicanPluginsSitemapStork
branch of my demo repository for testing Pelican.All files except those listed below are the result of running the command
pelican-quickstart
.pelicanconf.py
content/Articles/KiraArticle.md
:.circleci/config.yml
:3. Behavior before change
If custom
OUTPUT_PATH
on Windows, Pelican Stork search generate invalid path slashes for the value ofbase_directory
setting ofsearch.toml
file:If I run:
I get an error:
Full output:
4. Change
I applied
os.sep
to convert back-slashes to forward-slashes. I change the line ofsearch.py
:5. Behavior after change
search.toml
on Windows after my changes:This is the correct path for Windows. No errors in output.
6. UNIX possible consequences
My change shouldn’t affect *nix operating systems. I check it on Circle CI.
Circle CI build with configuration from the item 2.3 of this issue, generated
search.toml
:I change in my
config.yml
:Circle CI build, the same
search.toml
.I didn’t see anything changed in Ubuntu build after my change.
7. Reproducing problem
I can’t reproduce my problem on free remote CI services. Unfortunately, installing Stork on Windows isn’t quick. To install Stork, a Windows user must install Rust and compile Stork on his own machine. I can to compile Stork on my machine, but I was getting bugs on Circle CI and AppVeyor CI.
If you know how to compile Stork for Windows on free remote CI services, please, tell me. See also my issue on the Stork issue tracker.
8. Environment
Operating system:
Python — 3.10.5, 3.10.6
Pelican — 4.8.0
Stork — 1.5.0
pelican-search — 1.0.1
Thanks.