[Django] #23840: Confusing message from makemessages

13 views
Skip to first unread message

Django

unread,
Nov 15, 2014, 12:20:19 PM11/15/14
to django-...@googlegroups.com
#23840: Confusing message from makemessages
--------------------------------------+--------------------
Reporter: takis | Owner: nobody
Type: Bug | Status: new
Component: Internationalization | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+--------------------
When there's no locale dir available to store the gettext related messages
the makemessages command complains with the following message:
CommandError: Unable to find a locale path to store translations for file
db.sqlite3

If found the message rather confusing due to the messages referring to the
database file, implying that something was going wrong and it was trying
to find translatable strings in the sqlite database file.

Maybe it would be better if the filename wouldn't be mentioned?

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

Django

unread,
Nov 15, 2014, 1:15:53 PM11/15/14
to django-...@googlegroups.com
#23840: Confusing message from makemessages
--------------------------------------+------------------------------------

Reporter: takis | 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: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by claudep):

* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0


Comment:

Confirmed, we should definitely skip files with unrecognized extensions
sooner in the process, in `find_files`.

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

Django

unread,
Nov 15, 2014, 5:02:14 PM11/15/14
to django-...@googlegroups.com
#23840: Confusing message from makemessages
--------------------------------------+------------------------------------
Reporter: takis | Owner: iljamaas
Type: Bug | Status: assigned
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: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by iljamaas):

* owner: nobody => iljamaas
* status: new => assigned


Comment:

While looking into patching this I found out some IMHO strange behaviour.

If no --extension or --domain is provided makemessages claims to be
handling .txt and .html files ( via --verbosity=2 )

That is not really true as it is also handling all .py files.
Actually forcing --extension=html also gets the .py files handled

My patch changes this back to actually only handling the extensions
specified or .html .txt and .py if nothing is specified.

If using this, the find_files can skip all unwanted/unknown extensions,
even before diving into the TranslatableFiles

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

Django

unread,
Nov 15, 2014, 5:18:38 PM11/15/14
to django-...@googlegroups.com
#23840: Confusing message from makemessages
--------------------------------------+------------------------------------
Reporter: takis | Owner: iljamaas
Type: Bug | Status: assigned
Component: Internationalization | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by claudep):

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


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

Django

unread,
Nov 15, 2014, 5:26:46 PM11/15/14
to django-...@googlegroups.com
#23840: Confusing message from makemessages
--------------------------------------+------------------------------------
Reporter: takis | Owner: iljamaas
Type: Bug | Status: assigned
Component: Internationalization | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

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

Comment (by iljamaas):

@claudep Do you expect this to get covered by unittests somehow?

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

Django

unread,
Nov 16, 2014, 2:56:24 PM11/16/14
to django-...@googlegroups.com
#23840: Confusing message from makemessages
--------------------------------------+------------------------------------
Reporter: takis | Owner: iljamaas
Type: Bug | Status: assigned
Component: Internationalization | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

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

Comment (by claudep):

I've attached a (possible) failing test that should be fixed by the patch
(I didn't verify this).
@iljamaas Are you interested in creating a pull request on Github for this
ticket (combining both test and fix)?

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

Django

unread,
Nov 16, 2014, 2:59:23 PM11/16/14
to django-...@googlegroups.com
#23840: Confusing message from makemessages
--------------------------------------+------------------------------------
Reporter: takis | Owner: iljamaas
Type: Bug | Status: assigned
Component: Internationalization | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

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

Comment (by iljamaas):

@claudep I will make a git pullrequest with fix+test!

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

Django

unread,
Nov 16, 2014, 4:30:38 PM11/16/14
to django-...@googlegroups.com
#23840: Confusing message from makemessages
--------------------------------------+------------------------------------
Reporter: takis | Owner: iljamaas
Type: Bug | Status: assigned
Component: Internationalization | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

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

Comment (by iljamaas):

PR: https://github.com/django/django/pull/3559

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

Django

unread,
Nov 17, 2014, 3:21:59 AM11/17/14
to django-...@googlegroups.com
#23840: Confusing message from makemessages
--------------------------------------+------------------------------------
Reporter: takis | Owner: iljamaas
Type: Bug | Status: closed
Component: Internationalization | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Claude Paroz <claude@…>):

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


Comment:

In [changeset:"bb4a92d7845878b2ce0c4a5ca154cb4db22f7bad"]:
{{{
#!CommitTicketReference repository=""
revision="bb4a92d7845878b2ce0c4a5ca154cb4db22f7bad"
Fixed #23840 -- Fixed makemessages find_files method

Changed the handling of extensions to be used for gettext. Now
obeying the --extension argument. find_files now only find the
given or default extensions and puts only these in the
TranslatableFiles. As a result there are no more confusing messages
for filetypes (extension) not handled by makemessages.
}}}

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

Reply all
Reply to author
Forward
0 new messages