#34679: Cannot run collectstatic with existing unsupported manifest file
-------------------------------------+-------------------------------------
Reporter: Jarosław Wygoda | Owner: Jarosław
| Wygoda
Type: Bug | Status: new
Component: contrib.staticfiles | Version: 4.1
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jarosław Wygoda):
* cc: Jarosław Wygoda (added)
* status: closed => new
* resolution: needsinfo =>
Comment:
Hi Natalia,
I've already figured out this issue. Please take a look at my pr:
https://github.com/django/django/pull/17015/files
You can reproduce it either by reverting my changes in
`django/contrib/staticfiles/storage.py` and running
`TestManifestStaticFilesStorageRollback` or by running `./manage.py
collectstatic` with `ManifestStaticFilesStorage` on Django 4.1 and then on
Django 4.2.
Please find the traceback below.
{{{
Traceback (most recent call last):
File "/tests/django/tests/staticfiles_tests/test_storage.py", line 912,
in test_collectstatic_with_unsupported_version
self.run_collectstatic()
File "/tests/django/tests/staticfiles_tests/cases.py", line 89, in
run_collectstatic
call_command(
File "/tests/django/django/core/management/__init__.py", line 194, in
call_command
return command.execute(*args, **defaults)
File "/tests/django/django/core/management/base.py", line 458, in
execute
output = self.handle(*args, **options)
File
"/tests/django/django/contrib/staticfiles/management/commands/collectstatic.py",
line 184, in handle
if self.is_local_storage() and self.storage.location:
File
"/tests/django/django/contrib/staticfiles/management/commands/collectstatic.py",
line 245, in is_local_storage
return isinstance(self.storage, FileSystemStorage)
File "/tests/django/django/utils/functional.py", line 280, in
__getattribute__
value = super().__getattribute__(name)
File "/tests/django/django/utils/functional.py", line 251, in inner
self._setup()
File "/tests/django/django/contrib/staticfiles/storage.py", line 540, in
_setup
self._wrapped = storages[STATICFILES_STORAGE_ALIAS]
File "/tests/django/django/core/files/storage/handler.py", line 43, in
__getitem__
storage = self.create_storage(params)
File "/tests/django/django/core/files/storage/handler.py", line 55, in
create_storage
return storage_cls(**options)
File "/tests/django/django/contrib/staticfiles/storage.py", line 463, in
__init__
self.hashed_files, self.manifest_hash = self.load_manifest()
File "/tests/django/django/contrib/staticfiles/storage.py", line 484, in
load_manifest
raise ValueError(
ValueError: Couldn't load manifest 'staticfiles.json' (version 1.0)
}}}
Regards,
Jarek
--
Ticket URL: <https://code.djangoproject.com/ticket/34679#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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070188f8aa6a83-800a0702-186a-48e4-ad2c-7f6b2d06bb77-000000%40eu-central-1.amazonses.com.