#26591: Incorrect Manifest Keys for ManifestStaticFilesStorage on Windows
-------------------------------------+-------------------------------------
     Reporter:  dsanders11           |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  contrib.staticfiles  |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:  staticfiles          |             Triage Stage:  Accepted
  manifest                           |
  manifeststaticfileststorage        |
  windows                            |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by timgraham):

 * needs_better_patch:   => 0
 * needs_docs:   => 0
 * needs_tests:   => 0
 * stage:  Unreviewed => Accepted


Old description:

> The manifest created by `ManifestStaticFilesStorage` on Windows has some
> incorrect keys (haven't determined the pattern yet) where slashes are
> '\\' instead of '/'.
>
> This silently 'succeeds' because `HashedFilesMixin` will hash the
> original file on a 'cache miss' (in the case of
> `ManifestStaticFilesStorage` it's a manifest miss) and insert the result
> into the in-memory hashed files map.
>
> I've attached a patch for staticfiles_tests which checks that the
> manifest is the same in memory and on disk after the manifest tests
> finish (unless it was a test which cleared the in-memory version). It
> passes for the Linux build but fails on the Windows build, nicely
> illustrating the problem.

New description:

 The manifest created by `ManifestStaticFilesStorage` on Windows has some
 incorrect keys (haven't determined the pattern yet) where slashes are
 `'\\'` instead of '/'.

 This silently 'succeeds' because `HashedFilesMixin` will hash the original
 file on a 'cache miss' (in the case of `ManifestStaticFilesStorage` it's a
 manifest miss) and insert the result into the in-memory hashed files map.

 I've attached a patch for staticfiles_tests which checks that the manifest
 is the same in memory and on disk after the manifest tests finish (unless
 it was a test which cleared the in-memory version). It passes for the
 Linux build but fails on the Windows build, nicely illustrating the
 problem.

--

Comment:

 The final version of the patch shouldn't put the assertions in
 `tearDown()`, if possible.

--
Ticket URL: <https://code.djangoproject.com/ticket/26591#comment:1>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.db833c6b6c2a267f09cac6b98d3ec6e0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to