#25346: collectstatic --clear doesn't delete broken symlinks from the 
STATIC_ROOT
-------------------------------------+-------------------------------------
     Reporter:  ezheidtmann          |                    Owner:  nobody
         Type:  Uncategorized        |                   Status:  new
    Component:  contrib.staticfiles  |                  Version:  1.8
     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 ezheidtmann):

 * needs_docs:   => 0
 * needs_tests:   => 0
 * needs_better_patch:   => 0


Old description:

> In my STATIC_ROOT, I have a directory containing some broken symlinks.
>
> I run ./manage.py collectstatic -l -c
>
> I see "Deleting '...'" for each of the broken symlinks, and no
> corresponding "Linking '...'" lines. I would expect the broken symlinks
> to be gone. But they still exist.
>
> Steps to reproduce:
>
> {{{
> ln -s asdfasd_something_that_doesnt_exist_fasdfasdf
> $STATIC_ROOT/broken_symlink
> ls -l $STATIC_ROOT/broken_symlink
> ./manage.py collectstatic -l -c --noinput | grep broken_symlink
> ls -l $STATIC_ROOT/broken_symlink
> }}}
>
> How could the broken symlinks get there in the first place? I'm using
> collectstatic -l and I deleted the original static files from my app.
>
> (Why do I care? Because this causes real trouble when used with
> WhiteNoise, because it can't find the original file and fails to start)

New description:

 In my STATIC_ROOT, I have a directory containing some broken symlinks.

 I run ./manage.py collectstatic -l -c

 I see "Deleting '...'" for each of the broken symlinks, and no
 corresponding "Linking '...'" lines. I would expect the broken symlinks to
 be gone. But they still exist.

 Steps to reproduce:

 {{{
 ln -s asdfasd_something_that_doesnt_exist_fasdfasdf
 $STATIC_ROOT/broken_symlink
 ls -l $STATIC_ROOT/broken_symlink
 ./manage.py collectstatic -l -c --noinput | grep broken_symlink
 ls -l $STATIC_ROOT/broken_symlink
 }}}

 How could the broken symlinks get there in the first place? Answer: I'm
 using collectstatic -l and I deleted the original static files from my
 app, so the symlinks made last time still exist.

 (Why do I care? Answer: this causes real trouble when used with
 WhiteNoise, because it can't find the original file and fails to start)

--

--
Ticket URL: <https://code.djangoproject.com/ticket/25346#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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.7f5816cd5875feb80dc920318903b02b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to