Skip to content

library doesn't handle windows paths #222

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

Closed
reedjones opened this issue Apr 23, 2023 · 0 comments
Closed

library doesn't handle windows paths #222

reedjones opened this issue Apr 23, 2023 · 0 comments

Comments

@reedjones
Copy link
Contributor

reedjones commented Apr 23, 2023

Found a bug? Please fill out the sections below. 👍

The url regex doesn't account for windows paths that have '\'

A summary of the issue.

Steps to Reproduce

clone the main repo,
run the server, and you will get a PatternLibraryEmpty error because it can't find the paths
because patterns/atoms won't work on windows

so now we have to change our settings for windows style path

PATTERN_LIBRARY = {
#...
    "SECTIONS": [
        ("atoms", ["patterns\\atoms"]),  # was patterns/atoms 
        ("molecules", ["patterns\\molecules"]), # etc... 
        ("pages", ["patterns\\pages"]),
    ],
}

Now you will get an error about the url not matching because the url also doesn't handle windows paths

basically this r"^pattern/(?P<pattern_template_name>[\w./-]+%s)$"
should be r"^pattern/(?P<pattern_template_name>[\w./-\\]+%s)$"

  • Python version: 3+
  • Django version: 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant