Skip to content

library doesn't handle windows paths #222

@reedjones

Description

@reedjones

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions