Opened 8 years ago

Last modified 8 years ago

#27658 closed Bug

collectstatic overwrites newer files in remote storage — at Version 3

Reported by: Paolo Dente Owned by: nobody
Component: contrib.staticfiles Version: 1.10
Severity: Release blocker Keywords: staticfiles
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Paolo Dente)

@Tim: as far as I can tell, any non-local storage should be affected so a possible test would require mocking Storage or the management command so that Command.local() is False; I can try and write one. On the other hand, it looks like @Vitali spotted the problem with the refactoring, so I don't know how to proceed from here.

Change History (3)

comment:1 by Tim Graham, 8 years ago

Easy pickings: unset

Could you be more specific about the steps to reproduce the issue (ideally without S3 involved since Django's test suite cannot rely on that)? If you could provide a test case for tests/staticfiles_tests that would be great.

comment:2 by Rebkavets Vitali, 8 years ago

This line Github link
full_path for remote storages such as S3 is always None
The clause was improperly refactored
It should look like

...
                    if (target_last_modified.replace(microsecond=0) >= source_last_modified.replace(microsecond=0) and
                            not full_path or full_path and not (self.symlink ^ os.path.islink(full_path))):
...
Last edited 8 years ago by Rebkavets Vitali (previous) (diff)

comment:3 by Paolo Dente, 8 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top