Skip to content

Fix issue with static files on Windows#474

Open
marcperrinoptel wants to merge 2 commits intoevansd:mainfrom
marcperrinoptel:fix-issue-472
Open

Fix issue with static files on Windows#474
marcperrinoptel wants to merge 2 commits intoevansd:mainfrom
marcperrinoptel:fix-issue-472

Conversation

@marcperrinoptel
Copy link

See #472
also https://code.djangoproject.com/ticket/34341

The probable takeaway from the discussion on Django side is that finders.find() is really supposed to be called with an OS-standardized path.

I've mimicked what Django does to an url before calling finders.find():

  • step 1 (strip url base / prefix) was already done by whitenoise
  • step 2 (url2pathname) is obvious enough
  • step 3 (using posixpath.normpath, plus .lstrip('/')) seems debatable considering that we're already after url2pathname, but for the sake of mimicking Django I've included it

marcperrinoptel and others added 2 commits February 16, 2023 11:09
…url before calling finders.find (which really does need an OS-standardized path as input)
@Archmonger
Copy link
Contributor

This needs a test to ensure there aren't regressions.

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

Successfully merging this pull request may close these issues.

2 participants