[Python-modules-team] Bug#863026: Broken symlinks break collecstatic on deploy

Enrico Zini enrico at debian.org
Sat May 20 10:57:33 UTC 2017


Package: python-djangorestframework
Version: 3.4.0-2
Severity: important

Hello,

when using rest_framework in jessie, collectstatic raises this exception:

Copying '/usr/lib/python2.7/dist-packages/rest_framework/static/rest_framework/img/grid.png'
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 168, in handle
    collected = self.collect()
  File "/usr/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 107, in collect
    handler(path, prefixed_path, storage)
  File "/usr/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 314, in copy_file
    with source_storage.open(path) as source_file:
  File "/usr/lib/python2.7/dist-packages/django/core/files/storage.py", line 37, in open
    return self._open(name, mode)
  File "/usr/lib/python2.7/dist-packages/django/core/files/storage.py", line 201, in _open
    return File(open(self.path(name), mode))
IOError: [Errno 2] No such file or directory: u'/usr/lib/python2.7/dist-packages/rest_framework/static/rest_framework/img/grid.png'

This is because grid.png is a broken symlink:

$ readlink /usr/lib/python2.7/dist-packages/rest_framework/static/rest_framework/img/grid.png
../../../../../../../share/pyshared/rest_framework/static/rest_framework/img/grid.png
$ ls ../../../../../../../share/pyshared/rest_framework/static/rest_framework/img/grid.png
ls: cannot access ../../../../../../../share/pyshared/rest_framework/static/rest_framework/img/grid.png: No such file or directory


Enrico

-- System Information:
Debian Release: 9.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64
 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages python-djangorestframework depends on:
ii  python-django  1:1.10.7-1
pn  python:any     <none>

Versions of packages python-djangorestframework recommends:
ii  python-defusedxml       0.4.1-2
ii  python-django-filters   0.13.0-1
ii  python-django-guardian  1.4.4-1
ii  python-markdown         2.6.8-1
ii  python-pil              4.0.0-4
ii  python-yaml             3.12-1

Versions of packages python-djangorestframework suggests:
ii  python-djangorestframework-doc  3.4.0-2

-- no debconf information



More information about the Python-modules-team mailing list