Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#23897 closed Bug (duplicate)

makemessages does not work if STATIC_ROOT isn't defined

Reported by: Igor Koshkarov Owned by: nobody
Component: Internationalization Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Claude Paroz)

After new project is created, I have put into settings.py:

LOCALE_PATHS = (
    os.path.join(BASE_DIR, 'locale'),
)
LANGUAGES = (
    ('ru', 'Russian'),
    ('en', 'English'),
)

I have created directory 'locale' under BASE_PATH as well.
And after I ran ./manage.py makemessages -l ru I got:

Traceback (most recent call last):
  File "/Applications/PyCharm.app/Contents/helpers/pycharm/django_manage.py", line 41, in <module>
    run_module(manage_file, None, '__main__', True)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 176, in run_module
    fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/igo/PycharmProjects/TestTest/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/igo/Django/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/Users/igo/Django/lib/python2.7/site-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/igo/Django/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/Users/igo/Django/lib/python2.7/site-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/Users/igo/Django/lib/python2.7/site-packages/django/core/management/base.py", line 533, in handle
    return self.handle_noargs(**options)
  File "/Users/igo/Django/lib/python2.7/site-packages/django/core/management/commands/makemessages.py", line 283, in handle_noargs
    potfiles = self.build_potfiles()
  File "/Users/igo/Django/lib/python2.7/site-packages/django/core/management/commands/makemessages.py", line 299, in build_potfiles
    file_list = self.find_files(".")
  File "/Users/igo/Django/lib/python2.7/site-packages/django/core/management/commands/makemessages.py", line 358, in find_files
    ignored_roots = [os.path.normpath(p) for p in (settings.MEDIA_ROOT, settings.STATIC_ROOT)]
  File "/Users/igo/Django/lib/python2.7/posixpath.py", line 327, in normpath
    initial_slashes = path.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'

Change History (3)

comment:1 by Roman, 9 years ago

Is this duplicate of #23717 ?

comment:2 by Claude Paroz, 9 years ago

Resolution: duplicate
Status: newclosed

Yes, it is.

comment:3 by Claude Paroz, 9 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top