[Django] #24384: compilemessages shouldn't return with exit code 0 when it fails

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Django] #24384: compilemessages shouldn't return with exit code 0 when it fails

Django
#24384: compilemessages shouldn't return with exit code 0 when it fails
------------------------------------------------+------------------------
               Reporter:  aaugustin             |          Owner:  nobody
                   Type:  Bug                   |         Status:  new
              Component:  Internationalization  |        Version:  master
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 When compilemessages is run on a read-only location, it displays a
 messages to standard error and terminates with exit code 0. It should have
 exit code 1.

 Patch:

 {{{
 diff --git a/django/core/management/commands/compilemessages.py
 b/django/core/management/commands/compilemessages.py
 index dbadac0..75f3c57 100644
 --- a/django/core/management/commands/compilemessages.py
 +++ b/django/core/management/commands/compilemessages.py
 @@ -108,9 +108,9 @@ class Command(BaseCommand):

              # Check writability on first location
              if i == 0 and not is_writable(npath(base_path + '.mo')):
 -                self.stderr.write("The po files under %s are in a
 seemingly not writable location. "
 -                                  "mo files will not be updated/created."
 % dirpath)
 -                return
 +                raise CommandError("The po files under %s are in a
 seemingly "
 +                                   "not writable location. mo files will
 not "
 +                                   "be updated/created." % dirpath)

              args = [self.program] + self.program_options + ['-o',
                      npath(base_path + '.mo'), npath(base_path + '.po')]
 }}}

 With this change, the output is exactly the same, but the exit code
 reflects the failure and the --traceback option works.

 I don't quite have the motivation to write tests for this change :-/

--
Ticket URL: <https://code.djangoproject.com/ticket/24384>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/052.b029fbfb32d76a267626b9ed6f85e97d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #24384: compilemessages shouldn't return with exit code 0 when it fails

Django
#24384: compilemessages shouldn't return with exit code 0 when it fails
-------------------------------------+-------------------------------------
     Reporter:  aaugustin            |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:                       |                  Version:  master
  Internationalization               |
     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 claudep):

 The reason of the current behaviour is that `compilemessages` run
 `compile_messages` for all paths of `settings.LOCALE_PATHS`. The idea was
 to not stop running the command if only one path is read-only but not the
 others. When #24159 will be fixed, it's probable that `compile_messages`
 will be launched for all apps in `INSTALLED_APPS`. Then we don't want to
 fail when some app is read-only (maybe a third-party app in a non-readable
 location).

--
Ticket URL: <https://code.djangoproject.com/ticket/24384#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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.ee8dfd6340aa3cca6fd8d9b0c3172ad4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #24384: compilemessages shouldn't return with exit code 0 when it fails

Django
In reply to this post by Django
#24384: compilemessages shouldn't return with exit code 0 when it fails
-------------------------------------+-------------------------------------
     Reporter:  aaugustin            |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:                       |                  Version:  master
  Internationalization               |
     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 aaugustin):

 We have a problem akin to test discovery here. I think the right solution
 is to ignore anything outside the current working directory and error if a
 non-writable location is encountered.

--
Ticket URL: <https://code.djangoproject.com/ticket/24384#comment:2>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.256a6b50e786aa1b45d208c862ba785c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #24384: compilemessages shouldn't return with exit code 0 when it fails

Django
In reply to this post by Django
#24384: compilemessages shouldn't return with exit code 0 when it fails
-------------------------------------+-------------------------------------
     Reporter:  aaugustin            |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:                       |                  Version:  master
  Internationalization               |
     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 claudep):

 See #21732 for the initial use case about non-writable paths.

 Ignoring paths outside current directory could be a solution, but might be
 backwards incompatible.

--
Ticket URL: <https://code.djangoproject.com/ticket/24384#comment:3>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.37e2dccf0a5299f9983f4e41070fb69a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #24384: compilemessages shouldn't return with exit code 0 when it fails

Django
In reply to this post by Django
#24384: compilemessages shouldn't return with exit code 0 when it fails
--------------------------------------+------------------------------------
     Reporter:  aaugustin             |                    Owner:  nobody
         Type:  Bug                   |                   Status:  new
    Component:  Internationalization  |                  Version:  master
     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 timgraham):

 * stage:  Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/24384#comment:4>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.18f06eb234384a85a17d1b2278aee4dc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #24384: compilemessages shouldn't return with exit code 0 when it fails

Django
In reply to this post by Django
#24384: compilemessages shouldn't return with exit code 0 when it fails
-------------------------------------+-------------------------------------
     Reporter:  Aymeric Augustin     |                    Owner:  Claude
                                     |  Paroz
         Type:  Bug                  |                   Status:  assigned
    Component:                       |                  Version:  master
  Internationalization               |
     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 Claude Paroz):

 * owner:  nobody => Claude Paroz
 * status:  new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/24384#comment:5>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.f12e19d73ec4368381cee19523dc2990%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #24384: compilemessages shouldn't return with exit code 0 when it fails

Django
In reply to this post by Django
#24384: compilemessages shouldn't return with exit code 0 when it fails
-------------------------------------+-------------------------------------
     Reporter:  Aymeric Augustin     |                    Owner:  Claude
                                     |  Paroz
         Type:  Bug                  |                   Status:  assigned
    Component:                       |                  Version:  master
  Internationalization               |
     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 Claude Paroz):

 * has_patch:  0 => 1


Comment:

 [https://github.com/django/django/pull/10027 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/24384#comment:6>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.23e78a5c3b21491b4fe013bba835ad0b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #24384: compilemessages shouldn't return with exit code 0 when it fails

Django
In reply to this post by Django
#24384: compilemessages shouldn't return with exit code 0 when it fails
-------------------------------------+-------------------------------------
     Reporter:  Aymeric Augustin     |                    Owner:  Claude
                                     |  Paroz
         Type:  Bug                  |                   Status:  assigned
    Component:                       |                  Version:  master
  Internationalization               |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             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 Carlton Gibson):

 * stage:  Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/24384#comment:7>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/067.e261ef1a5f209041dc6fb0caad62e0e4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #24384: compilemessages shouldn't return with exit code 0 when it fails

Django
In reply to this post by Django
#24384: compilemessages shouldn't return with exit code 0 when it fails
-------------------------------------+-------------------------------------
     Reporter:  Aymeric Augustin     |                    Owner:  Claude
                                     |  Paroz
         Type:  Bug                  |                   Status:  closed
    Component:                       |                  Version:  master
  Internationalization               |
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             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 Claude Paroz <claude@…>):

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


Comment:

 In [changeset:"a77f21880dfb0631ea0adb22d47909915cbfc3a9" a77f2188]:
 {{{
 #!CommitTicketReference repository=""
 revision="a77f21880dfb0631ea0adb22d47909915cbfc3a9"
 Fixed #24384 -- Allowed compilemessages to continue running after nonfatal
 errors.

 Thanks Aymeric Augustin for the report and Carlton Gibson and Tim Graham
 for
 the reviews.
 }}}

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