[Django] #34821: Syncing DEFAULT_FILE_STORAGE/STATICFILES_STORAGE settings with STORAGES can mutate user settings.

3 views
Skip to first unread message

Django

unread,
Sep 8, 2023, 3:31:06 AM9/8/23
to django-...@googlegroups.com
#34821: Syncing DEFAULT_FILE_STORAGE/STATICFILES_STORAGE settings with STORAGES can
mutate user settings.
-------------------------------------+-------------------------------------
Reporter: Mariusz | Owner: Mariusz Felisiak
Felisiak |
Type: Bug | Status: assigned
Component: | Version: 4.2
contrib.staticfiles |
Severity: Release | Keywords:
blocker |
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Syncing DEFAULT_FILE_STORAGE/STATICFILES_STORAGE settings with STORAGES
can mutate user settings. An isolation issue can be observed by running
tests in the specific order, e.g.
{{{
./runtests.py deprecation staticfiles_tests --shuffle=1352276316
--parallel=1

...

======================================================================
ERROR: test_no_warning_when_staticdir_does_not_exist
(staticfiles_tests.test_management.TestInteractiveMessages)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/django/tests/staticfiles_tests/cases.py", line 77, in setUp
self.run_collectstatic()
File "/django/tests/staticfiles_tests/cases.py", line 89, in
run_collectstatic
call_command(
File "/django/django/core/management/__init__.py", line 194, in
call_command
return command.execute(*args, **defaults)
File "/django/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
File
"/django/django/contrib/staticfiles/management/commands/collectstatic.py",
line 209, in handle
collected = self.collect()
File
"/django/django/contrib/staticfiles/management/commands/collectstatic.py",
line 126, in collect
for path, storage in finder.list(self.ignore_patterns):
File "/django/django/contrib/staticfiles/finders.py", line 266, in list
for path in utils.get_files(self.storage, ignore_patterns):
File "/django/django/contrib/staticfiles/utils.py", line 23, in
get_files
directories, files = storage.listdir(location)
File "/django/django/core/files/storage/base.py", line 148, in listdir
raise NotImplementedError(
NotImplementedError: subclasses of Storage must provide a listdir() method

======================================================================
FAIL: test_location_empty (staticfiles_tests.test_finders.TestMiscFinder)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/django/django/test/utils.py", line 443, in inner
return func(*args, **kwargs)
File "/django/tests/staticfiles_tests/test_finders.py", line 124, in
test_location_empty
with self.assertRaisesMessage(ImproperlyConfigured, msg):
File "/usr/local/lib/python3.10/contextlib.py", line 142, in __exit__
next(self.gen)
File "/django/django/test/testcases.py", line 739, in
_assert_raises_or_warns_cm
with func(expected_exception) as cm:
AssertionError: ImproperlyConfigured not raised


----------------------------------------------------------------------
Ran 203 tests in 3.158s

FAILED (failures=1, errors=69)
Used shuffle seed: 1352276316 (given)
Destroying test database for alias 'default'...
}}}


Regression in 6b965c600054f970bdf94017ecf2e0e6e0a4326b (check out #34773).

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

Django

unread,
Sep 8, 2023, 4:00:39 AM9/8/23
to django-...@googlegroups.com
#34821: Syncing DEFAULT_FILE_STORAGE/STATICFILES_STORAGE settings with STORAGES can
mutate user settings.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz

| Felisiak
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/17236 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/34821#comment:1>

Django

unread,
Sep 8, 2023, 7:56:01 AM9/8/23
to django-...@googlegroups.com
#34821: Syncing DEFAULT_FILE_STORAGE/STATICFILES_STORAGE settings with STORAGES can
mutate user settings.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
| Felisiak
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/34821#comment:2>

Django

unread,
Sep 8, 2023, 11:42:35 AM9/8/23
to django-...@googlegroups.com
#34821: Syncing DEFAULT_FILE_STORAGE/STATICFILES_STORAGE settings with STORAGES can
mutate user settings.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
| Felisiak
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/34821#comment:3>

Django

unread,
Sep 8, 2023, 2:30:29 PM9/8/23
to django-...@googlegroups.com
#34821: Syncing DEFAULT_FILE_STORAGE/STATICFILES_STORAGE settings with STORAGES can
mutate user settings.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
| Felisiak
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/34821#comment:4>

Django

unread,
Sep 8, 2023, 2:31:06 PM9/8/23
to django-...@googlegroups.com
#34821: Syncing DEFAULT_FILE_STORAGE/STATICFILES_STORAGE settings with STORAGES can
mutate user settings.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
| Felisiak
Type: Bug | Status: assigned
Component: contrib.staticfiles | Version: 4.2
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/34821#comment:5>

Django

unread,
Sep 11, 2023, 7:04:43 AM9/11/23
to django-...@googlegroups.com
#34821: Syncing DEFAULT_FILE_STORAGE/STATICFILES_STORAGE settings with STORAGES can
mutate user settings.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
| Felisiak
Type: Bug | Status: closed
Component: contrib.staticfiles | Version: 4.2
Severity: Release blocker | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by GitHub <noreply@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"a7c73b944f51d6c92ec876fd7e0a171e7c01657d" a7c73b9]:
{{{
#!CommitTicketReference repository=""
revision="a7c73b944f51d6c92ec876fd7e0a171e7c01657d"
Fixed #34821 -- Prevented DEFAULT_FILE_STORAGE/STATICFILES_STORAGE
settings from mutating the main STORAGES.

Regression in 6b965c600054f970bdf94017ecf2e0e6e0a4326b.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34821#comment:6>

Django

unread,
Sep 11, 2023, 7:05:27 AM9/11/23
to django-...@googlegroups.com
#34821: Syncing DEFAULT_FILE_STORAGE/STATICFILES_STORAGE settings with STORAGES can
mutate user settings.
-------------------------------------+-------------------------------------
Reporter: Mariusz Felisiak | Owner: Mariusz
| Felisiak
Type: Bug | Status: closed
Component: contrib.staticfiles | Version: 4.2
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"97e8a2afb127fad8c71d084954a6bc38661375dd" 97e8a2af]:
{{{
#!CommitTicketReference repository=""
revision="97e8a2afb127fad8c71d084954a6bc38661375dd"
[4.2.x] Fixed #34821 -- Prevented DEFAULT_FILE_STORAGE/STATICFILES_STORAGE


settings from mutating the main STORAGES.

Regression in 6b965c600054f970bdf94017ecf2e0e6e0a4326b.
Backport of a7c73b944f51d6c92ec876fd7e0a171e7c01657d from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34821#comment:7>

Reply all
Reply to author
Forward
0 new messages