[Django] #27522: ./manage runserver --nostatic doesn't return a traceback

198 views
Skip to first unread message

Django

unread,
Nov 22, 2016, 3:48:44 AM11/22/16
to django-...@googlegroups.com
#27522: ./manage runserver --nostatic doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Jeroen | Owner: nobody
van Veen |
Type: Bug | Status: assigned
Component: Core | Version: 1.10
(Management commands) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
When running ./manage runserver --nostatic, I expect a traceback to be
returned when
a syntax error occurs, and I expect the autoreloader still to be
available. Instead, the
runserver command exits like:

usage: manage.py runserver [-h] [--version] [-v {0,1,2,3}]
[--settings SETTINGS] [--pythonpath PYTHONPATH]
[--traceback] [--no-color] [--ipv6]
[--nothreading]
[--noreload]
[addrport]
manage.py runserver: error: unrecognized arguments: --nostatic

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

Django

unread,
Nov 22, 2016, 4:00:36 AM11/22/16
to django-...@googlegroups.com
#27522: ./manage runserver --nostatic doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Jeroen van Veen | Owner: nobody
Type: Bug | Status: assigned
Component: Core (Management | Version: 1.10
commands) |
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
-------------------------------------+-------------------------------------

Comment (by Jeroen van Veen):

This is a workaround:


{{{
--- __init__.py.orig 2016-11-22 09:58:38.806209538 +0100
+++ __init__.py 2016-11-22 09:58:47.656120244 +0100
@@ -323,6 +323,10 @@
apps.all_models = defaultdict(OrderedDict)
apps.app_configs = OrderedDict()
apps.apps_ready = apps.models_ready = apps.ready =
True
+ # Execute the runserver command, but strip off
additional
+ # parameters that cause the argument parser to fail.
+
self.fetch_command(subcommand).run_from_argv(self.argv[0:2])
+ return

# In all other cases, django.setup() is required to succeed.
else:
}}}

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

Django

unread,
Nov 22, 2016, 4:01:02 AM11/22/16
to django-...@googlegroups.com
#27522: ./manage runserver --nostatic doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Jeroen van Veen | Owner: nobody
Type: Bug | Status: assigned

Component: Core (Management | Version: 1.10
commands) |
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
-------------------------------------+-------------------------------------
Description changed by Jeroen van Veen:

Old description:

> When running ./manage runserver --nostatic, I expect a traceback to be
> returned when
> a syntax error occurs, and I expect the autoreloader still to be
> available. Instead, the
> runserver command exits like:
>
> usage: manage.py runserver [-h] [--version] [-v {0,1,2,3}]
> [--settings SETTINGS] [--pythonpath
> PYTHONPATH]
> [--traceback] [--no-color] [--ipv6]
> [--nothreading]
> [--noreload]
> [addrport]
> manage.py runserver: error: unrecognized arguments: --nostatic

New description:

When running ./manage runserver --nostatic, I expect a traceback to be
returned when
a syntax error occurs, and I expect the autoreloader still to be
available. Instead, the
runserver command exits like:


{{{
usage: manage.py runserver [-h] [--version] [-v {0,1,2,3}]
[--settings SETTINGS] [--pythonpath PYTHONPATH]
[--traceback] [--no-color] [--ipv6]
[--nothreading]
[--noreload]
[addrport]
manage.py runserver: error: unrecognized arguments: --nostatic
}}}

--

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

Django

unread,
Nov 22, 2016, 4:27:51 AM11/22/16
to django-...@googlegroups.com
#27522: ./manage runserver --nostatic doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Jeroen van Veen | Owner: nobody
Type: Bug | Status: assigned

Component: Core (Management | Version: 1.10
commands) |
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
-------------------------------------+-------------------------------------

Comment (by Jeroen van Veen):

Please let me know if it needs some more work! :)

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

Django

unread,
Nov 22, 2016, 4:28:37 AM11/22/16
to django-...@googlegroups.com
#27522: ./manage runserver --nostatic doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Jeroen van Veen | Owner: nobody
Type: Bug | Status: assigned

Component: Core (Management | Version: 1.10
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jeroen van Veen):

* stage: Unreviewed => Accepted


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

Django

unread,
Nov 22, 2016, 4:29:45 AM11/22/16
to django-...@googlegroups.com
#27522: ./manage runserver --nostatic doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Jeroen van Veen | Owner: nobody
Type: Bug | Status: assigned
Component: Core (Management | Version: 1.8

commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jeroen van Veen):

* version: 1.10 => 1.8


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

Django

unread,
Nov 22, 2016, 4:30:15 AM11/22/16
to django-...@googlegroups.com
#27522: ./manage runserver --nostatic doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Jeroen van Veen | Owner: nobody
Type: Bug | Status: assigned

Component: Core (Management | Version: 1.8
commands) |
Severity: Normal | Resolution:
Keywords: runserver nostatic | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jeroen van Veen):

* keywords: => runserver nostatic


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

Django

unread,
Nov 22, 2016, 7:25:24 AM11/22/16
to django-...@googlegroups.com
#27522: ./manage runserver --nostatic doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Jeroen van Veen | Owner: nobody
Type: Bug | Status: assigned
Component: Core (Management | Version: master

commands) |
Severity: Normal | Resolution:
Keywords: runserver nostatic | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jeroen van Veen):

* version: 1.8 => master


Old description:

> When running ./manage runserver --nostatic, I expect a traceback to be
> returned when
> a syntax error occurs, and I expect the autoreloader still to be
> available. Instead, the
> runserver command exits like:
>

> {{{
> usage: manage.py runserver [-h] [--version] [-v {0,1,2,3}]
> [--settings SETTINGS] [--pythonpath
> PYTHONPATH]
> [--traceback] [--no-color] [--ipv6]
> [--nothreading]
> [--noreload]
> [addrport]
> manage.py runserver: error: unrecognized arguments: --nostatic
> }}}

New description:

When running ./manage runserver --nostatic, I expect a traceback to be
returned when
a syntax error occurs, and I expect the autoreloader still to be
available. Instead, the
runserver command exits like:


{{{
usage: manage.py runserver [-h] [--version] [-v {0,1,2,3}]
[--settings SETTINGS] [--pythonpath PYTHONPATH]
[--traceback] [--no-color] [--ipv6]
[--nothreading]
[--noreload]
[addrport]
manage.py runserver: error: unrecognized arguments: --nostatic
}}}

Ticket: https://github.com/wearespindle/django/tree/ticket_27522

--

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

Django

unread,
Nov 22, 2016, 8:26:14 AM11/22/16
to django-...@googlegroups.com
#27522: ./manage runserver --nostatic doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Jeroen van Veen | Owner: nobody
Type: Bug | Status: assigned

Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: runserver nostatic | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

I can reproduce the problem. Without taking a closer look, I'm not sure
about the solution. If you could write a test, that would certainly help.

--
Ticket URL: <https://code.djangoproject.com/ticket/27522#comment:8>

Django

unread,
Nov 22, 2016, 9:41:34 AM11/22/16
to django-...@googlegroups.com
#27522: ./manage runserver --nostatic doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Jeroen van Veen | Owner: nobody
Type: Bug | Status: assigned

Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: runserver nostatic | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* has_patch: 0 => 1
* needs_tests: 0 => 1


Old description:

> When running ./manage runserver --nostatic, I expect a traceback to be
> returned when
> a syntax error occurs, and I expect the autoreloader still to be
> available. Instead, the
> runserver command exits like:
>

> {{{
> usage: manage.py runserver [-h] [--version] [-v {0,1,2,3}]
> [--settings SETTINGS] [--pythonpath
> PYTHONPATH]
> [--traceback] [--no-color] [--ipv6]
> [--nothreading]
> [--noreload]
> [addrport]
> manage.py runserver: error: unrecognized arguments: --nostatic
> }}}
>

> Ticket: https://github.com/wearespindle/django/tree/ticket_27522

New description:

When running `./manage runserver --nostatic`, I expect a traceback to be


returned when
a syntax error occurs, and I expect the autoreloader still to be
available. Instead, the
runserver command exits like:

{{{
usage: manage.py runserver [-h] [--version] [-v {0,1,2,3}]
[--settings SETTINGS] [--pythonpath PYTHONPATH]
[--traceback] [--no-color] [--ipv6]
[--nothreading]
[--noreload]
[addrport]
manage.py runserver: error: unrecognized arguments: --nostatic
}}}

--

Comment:

[https://github.com/django/django/pull/7595 PR] (currently without tests)

--
Ticket URL: <https://code.djangoproject.com/ticket/27522#comment:9>

Django

unread,
Nov 22, 2016, 9:58:13 AM11/22/16
to django-...@googlegroups.com
#27522: ./manage runserver --nostatic doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Jeroen van Veen | Owner: nobody
Type: Bug | Status: assigned

Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: runserver nostatic | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jeroen van Veen):

* needs_tests: 1 => 0


Old description:

> When running `./manage runserver --nostatic`, I expect a traceback to be


> returned when
> a syntax error occurs, and I expect the autoreloader still to be
> available. Instead, the
> runserver command exits like:
>
> {{{
> usage: manage.py runserver [-h] [--version] [-v {0,1,2,3}]
> [--settings SETTINGS] [--pythonpath
> PYTHONPATH]
> [--traceback] [--no-color] [--ipv6]
> [--nothreading]
> [--noreload]
> [addrport]
> manage.py runserver: error: unrecognized arguments: --nostatic
> }}}

New description:

When running ./manage runserver --nostatic, I expect a traceback to be
returned when
a syntax error occurs, and I expect the autoreloader still to be
available. Instead, the
runserver command exits like:


{{{
usage: manage.py runserver [-h] [--version] [-v {0,1,2,3}]
[--settings SETTINGS] [--pythonpath PYTHONPATH]
[--traceback] [--no-color] [--ipv6]
[--nothreading]
[--noreload]
[addrport]
manage.py runserver: error: unrecognized arguments: --nostatic
}}}

Ticket: https://github.com/wearespindle/django/tree/ticket_27522

--

Comment:

I'm trying to figure out where this test should be placed.

--
Ticket URL: <https://code.djangoproject.com/ticket/27522#comment:10>

Django

unread,
Nov 22, 2016, 2:13:57 PM11/22/16
to django-...@googlegroups.com
#27522: ./manage runserver --nostatic doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Jeroen van Veen | Owner: nobody
Type: Bug | Status: assigned

Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: runserver nostatic | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_tests: 0 => 1


Comment:

Some tests for `runserver` are in `admin_scripts/tests.py`. It might be
infeasible to test this (for example,
fe6ddb837d18bd4e71cd22fc18272d31478b19f2 lacked tests) but it would be
nice to try.

--
Ticket URL: <https://code.djangoproject.com/ticket/27522#comment:11>

Django

unread,
Dec 15, 2016, 11:38:35 AM12/15/16
to django-...@googlegroups.com
#27522: ./manage runserver --nostatic doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Jeroen van Veen | Owner: nobody
Type: Bug | Status: assigned

Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: runserver nostatic | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

Now I'm having trouble reproducing the issue. I'm using the tutorial
project and editing a syntax error in `views.py`. I see the error in the
runserver console output, then edit `views.py` to fix the mistake the the
server reloads. Do you have any more specific steps? You set the version
1.8 -- are you also reproducing the issue on master?

--
Ticket URL: <https://code.djangoproject.com/ticket/27522#comment:12>

Django

unread,
Dec 30, 2016, 2:41:58 PM12/30/16
to django-...@googlegroups.com
#27522: ./manage runserver --nostatic doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Jeroen van Veen | Owner: nobody
Type: Bug | Status: assigned

Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution:
Keywords: runserver nostatic | 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 Tim Graham):

* needs_tests: 1 => 0
* stage: Accepted => Ready for checkin


Comment:

Steps to reproduce: modify a Django project to have a syntax error and run
`runserver --nostatic`. You should see the `SyntaxError` traceback (after
this fix) rather than `manage.py runserver: error: unrecognized arguments:
--nostatic`.

I don't think it's feasible to write a test for this so I'll commit the
change without one.

--
Ticket URL: <https://code.djangoproject.com/ticket/27522#comment:13>

Django

unread,
Jan 2, 2017, 9:02:19 AM1/2/17
to django-...@googlegroups.com
#27522: ./manage runserver --nostatic doesn't return a traceback
-------------------------------------+-------------------------------------
Reporter: Jeroen van Veen | Owner: nobody
Type: Bug | Status: closed

Component: Core (Management | Version: master
commands) |
Severity: Normal | Resolution: fixed

Keywords: runserver nostatic | 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 Tim Graham <timograham@…>):

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


Comment:

In [changeset:"ed4264c5a44f01a626114e82240c977889e4a972" ed4264c5]:
{{{
#!CommitTicketReference repository=""
revision="ed4264c5a44f01a626114e82240c977889e4a972"
Fixed #27522 -- Fixed runserver autoreload when using staticfile's
options.

On a SyntaxError, made runserver exit with a stacktrace when using
contrib.staticfiles's runserver options such as --nostatic.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27522#comment:14>

Reply all
Reply to author
Forward
0 new messages