#19046: staticfiles not finding the files on Windows
-------------------------------------+-------------------------------------
     Reporter:  nelutzu_13@…         |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.staticfiles  |                  Version:  1.4
     Severity:  Normal               |               Resolution:  needsinfo
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by jezdez):

 * status:  new => closed
 * resolution:   => needsinfo


Comment:

 posixpath is the module that is used on POSIX systems when import os.path.
 It uses the hardcoded forward slash and a couple of other things different
 to the ntpath module that does the same for Windows systems. In other
 words os.path just a facade for the platform specific tools. The different
 modules are documented on http://docs.python.org/2/library/os.path.html

 The lstrip('/') happens there since the path passed to the serve view may
 be formatted as `http://localhost:8000/static///someother/file.ext` making
 path having a value of `//someother/file.ext`. The posix.normpath happens
 there to remove redundancies in the path (e.g. `path/to/../some//file.ext`
 is converted to `path/some/file.ext`). The finder api expects that kind of
 cleaned up name to make sure it does the right thing later on.

 As I'm not able to reproduce the issue with the current code, I'm closing
 as needsinfo. A testcase that demostrates the issue would be appreciated,
 for example.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19046#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to