﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24403	makemessages when run for a django app and no settings will fail on settings.STATIC_ROOT and settings.MEDIA_ROOT not being set	Carsten Klein	nobody	"In management/commands/makemessages.py it reads in line 375

{{{
ignored_roots = [os.path.normpath(p) for p in (settings.MEDIA_ROOT, settings.STATIC_ROOT)]
}}}

This will fail in situations where there is no STATIC_ROOT a/o MEDIA_ROOT, in which case ignored_roots will be populated with None, causing the subsequent path operation os.normpath(p) to fail.

This in turn will prevent users from generating the po files for django apps that do not have any such settings.

In order to fix this, the following code seems to work quite well

{{{
375         ignored_roots = []
376         if settings.MEDIA_ROOT:
377             ignored_roots.extend([os.path.normpath(p) for p in settings.MEDIA_ROOT])
378         if settings.STATIC_ROOT:
379             ignored_roots.extend([os.path.normpath(p) for p in settings.STATIC_ROOT])
}}}


----

I am using Django 1.8 installed via PyPi

{{{
# pip2 show django
---
Name: Django
Version: 1.8.dev20141027110112
}}}
"	Bug	closed	Core (Management commands)	1.8alpha1	Normal	duplicate		github.vibepy@…	Unreviewed	0	0	0	0	0	0
