I did hit a couple of issues:
1. The args for loaddata had 'fixture, fixture, ...' I thought it should
be 'fixture [fixture ...]' (without the commas) and changed it in the
patch.
2. runfcgi had its own help option for printing help. I fiddled with it
a little so that 'django-admin.py help runfcgi' prints something
consistent with what all the other commands do.
The patch (which is surprisingly puny for the mental gymnastics I feel
like I had to do) is at http://code.djangoproject.com/ticket/5369
Comments appreciated!
Todd
Great stuff, Todd. I've committed it in [6075]. I left a few comments
at http://code.djangoproject.com/ticket/5369 about the main changes I
made to the patch, but otherwise all was used pretty much as-is.
Thanks for your work!
Adrian
--
Adrian Holovaty
holovaty.com | djangoproject.com
Woo-hoo! To quote Sally Field, "You like me, you really like me."
And thanks for the clean-up of the option_list mess. I was thinking like
a Java programmer and missed the clean, Pythonic way of dealing with
that.
Now, I think it should be possible to let apps add their own commands
pretty cleanly...
Todd
It would seem this broke reloading of the built-in web server.
Are you sure it's broken? I just checked and it's still working for me.
Todd
I'm seeing breakage too: I haven't tested it that extensively, but I'm
getting the following pair of tracebacks consistently on Windows on
the first reload of the server:
------
Traceback (most recent call last):
File "C:\eclipse\infrastructure\django\django\core\management\base.py", line 6
4, in run
self.execute(*args, **options.__dict__)
File "C:\eclipse\infrastructure\django\django\core\management\base.py", line 8
1, in execute
output = self.handle(*args, **options)
File "C:\eclipse\infrastructure\django\django\core\management\commands\runserv
er.py", line 75, in handle
autoreload.main(inner_run)
File "C:\eclipse\infrastructure\django\django\utils\autoreload.py", line 90, i
n main
reloader_thread()
File "C:\eclipse\infrastructure\django\django\utils\autoreload.py", line 65, i
n reloader_thread
sys.exit(3) # force reload
SystemExit: 3
usage: runserver [options] [optional port number, or ipaddr:port]
Starts a lightweight Web server for development.
Traceback (most recent call last):
File "C:\eclipse\infrastructure\django\django\core\management\base.py", line 6
4, in run
self.execute(*args, **options.__dict__)
File "C:\eclipse\infrastructure\django\django\core\management\base.py", line 8
1, in execute
output = self.handle(*args, **options)
File "C:\eclipse\infrastructure\django\django\core\management\commands\runserv
er.py", line 75, in handle
autoreload.main(inner_run)
File "C:\eclipse\infrastructure\django\django\utils\autoreload.py", line 95, i
n main
sys.exit(restart_with_reloader())
SystemExit: 0
usage: runserver [options] [optional port number, or ipaddr:port]
Starts a lightweight Web server for development.
------
I haven't dug into this too far, but if I had to guess I'd say the
order of arguments passed to the respawn doesn't match the arguments
originally passed to the server.
Yours,
Russ Magee %-)
Hmm, I confirm I get the same error on OS X -- it happens after the
server is reloaded. How strange...
Strangely, though, I got a clean reload on Linux.
Todd
So if we have several confirmations of breakage, shouldn't it be
rolled back?
That doesn't make any sense, though. Which part of the code changes
sys.argv? I can't seem to find it. Does the optparse module do that?
And we were already using optparse before...
Nah, no need to roll this one back, unless it takes forever to figure
out. The changeset has too many files, and the breakage isn't
horrible.
I didn't change sys.argv at all. It's possible optparse does, but you're
right that this is odd. I'll take another look in the morning. I still
haven't seen the error on Linux, though.
Todd
I've fixed that in [6094].
It looks like sys.exit(3) is raising an exception that no one has ever
noticed before. Not sure if it's worth it, but maybe specifying a more
specific kind of exception would solve the problem.
Todd