Re: [Django] #29133: call_command() fails if a required option is passed in via **options

2018-03-02 Thread Django
#29133: call_command() fails if a required option is passed in via **options
-+-
 Reporter:  Alex Tomic   |Owner:  Alex
 Type:   |  Tomic
  Cleanup/optimization   |   Status:  closed
Component:  Core (Management |  Version:  2.0
  commands)  |
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham ):

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


Comment:

 In [changeset:"a1a3e515616da102fc48a1e1af8a5b2f429f747e" a1a3e51]:
 {{{
 #!CommitTicketReference repository=""
 revision="a1a3e515616da102fc48a1e1af8a5b2f429f747e"
 Fixed #29133 -- Fixed call_command() crash if a required option is passed
 in options.
 }}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.785c9d679bc3d1853ddb273f4b83a15b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29133: call_command() fails if a required option is passed in via **options

2018-02-23 Thread Django
#29133: call_command() fails if a required option is passed in via **options
-+-
 Reporter:  Alex Tomic   |Owner:  Alex
 Type:   |  Tomic
  Cleanup/optimization   |   Status:  assigned
Component:  Core (Management |  Version:  2.0
  commands)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Alex Tomic):

 * needs_better_patch:  1 => 0


Comment:

 Thanks for the feedback. I've simplified the test case and supporting
 management command to only test what was not working before, and pushed up
 a new commit.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.c0aeda655de38a8ef5e4a66c7437acf9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29133: call_command() fails if a required option is passed in via **options

2018-02-22 Thread Django
#29133: call_command() fails if a required option is passed in via **options
-+-
 Reporter:  Alex Tomic   |Owner:  Alex
 Type:   |  Tomic
  Cleanup/optimization   |   Status:  assigned
Component:  Core (Management |  Version:  2.0
  commands)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * needs_better_patch:  0 => 1
 * stage:  Unreviewed => Accepted


Comment:

 After looking at the fix, I simplified it a bit and I think it's fine to
 fix this. I left comments for improvement on the PR.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.07547f8933a197b54f52fa23757872d2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29133: call_command() fails if a required option is passed in via **options

2018-02-16 Thread Django
#29133: call_command() fails if a required option is passed in via **options
-+-
 Reporter:  Alex Tomic   |Owner:  Alex
 Type:   |  Tomic
  Cleanup/optimization   |   Status:  assigned
Component:  Core (Management |  Version:  2.0
  commands)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Alex Tomic):

 Replying to [comment:2 Tim Graham]:
 > I'm not sure if the additional code complexity is worth supporting this.
 I noted this recommendation from the Python documentation, "Required
 options are generally considered bad form because users expect options to
 be optional, and thus they should be avoided when possible." An
 alternative could be to document the limitation.

 Thanks for the quick feedback.

 I figured this would be a 1-2 line fix, but it turned out to be a bit more
 complex than I thought. I agree it's a bit unnecessary given that the
 python docs recommend against this practice. Ironically, I ran up against
 this as I was trying to wrap a few such unwieldy management commands doing
 exactly that.

 I don't believe it is universally agreed upon that -/-- parameters should
 always be optional, though, outside of the Python world. Getopt_long [ 1 ]
 and the Open Group utility conventions [ 2 ], for example, don't recommend
 against it as far as I can tell.

 All that said, if this patch seems too risky to fix such a minor issue,
 I'd also be happy to contribute a documentation change instead.

 [1] https://www.gnu.org/software/libc/manual/html_node/Getopt-Long-
 Options.html#Getopt-Long-Options
 [2]
 http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html
 e.g. Section 12.1.9

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.3298c0c31f00adfe4a61ca2b5d2bfca0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29133: call_command() fails if a required option is passed in via **options (was: django.core.management.call_command fails if required option passed in via **options)

2018-02-15 Thread Django
#29133: call_command() fails if a required option is passed in via **options
-+-
 Reporter:  Alex Tomic   |Owner:  Alex
 Type:   |  Tomic
  Cleanup/optimization   |   Status:  assigned
Component:  Core (Management |  Version:  2.0
  commands)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * type:  Uncategorized => Cleanup/optimization


Comment:

 I'm not sure if the additional code complexity is worth supporting this. I
 noted this recommendation from the Python documentation, "Required options
 are generally considered bad form because users expect options to be
 optional, and thus they should be avoided when possible." An alternative
 could be to document the limitation.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.204c21615b78c928cdfcecb0c85f32c3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.