我一直使用這個腳本編譯django.po並且它一直在努力:的I18n停止工作
#!/bin/sh
django-admin.py makemessages -a
django-admin.py compilemessages
它突然停止了工作,與此錯誤:
$ i18n.sh
Traceback (most recent call last):
File "c:/Python34/Scripts/django-admin.py", line 5, in <module>
management.execute_from_command_line()
File "c:\Python34\lib\site-packages\django\core\management\__init__.py", line
385, in execute_from_command_line
utility.execute()
File "c:\Python34\lib\site-packages\django\core\management\__init__.py", line
377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "c:\Python34\lib\site-packages\django\core\management\base.py", line 288,
in run_from_argv
self.execute(*args, **options.__dict__)
File "c:\Python34\lib\site-packages\django\core\management\base.py", line 338,
in execute
output = self.handle(*args, **options)
File "c:\Python34\lib\site-packages\django\core\management\base.py", line 533,
in handle
return self.handle_noargs(**options)
File "c:\Python34\lib\site-packages\django\core\management\commands\makemessag
es.py", line 283, in handle_noargs
potfiles = self.build_potfiles()
File "c:\Python34\lib\site-packages\django\core\management\commands\makemessag
es.py", line 299, in build_potfiles
file_list = self.find_files(".")
File "c:\Python34\lib\site-packages\django\core\management\commands\makemessag
es.py", line 358, in find_files
ignored_roots = [os.path.normpath(p) for p in (settings.MEDIA_ROOT, settings
.STATIC_ROOT)]
File "c:\Python34\lib\site-packages\django\core\management\commands\makemessag
es.py", line 358, in <listcomp>
ignored_roots = [os.path.normpath(p) for p in (settings.MEDIA_ROOT, settings
.STATIC_ROOT)]
File "c:\Python34\lib\ntpath.py", line 491, in normpath
if path.startswith(special_prefixes):
AttributeError: 'NoneType' object has no attribute 'startswith'
processing file django.po in c:\Users\Debora\workspace\opti\opti2.0\project\loca
le\pt_BR\LC_MESSAGES
任何人有任何想法?
我不知道是什麼引起的。最近我更新了django 1.7到1.7.1,安裝了一些不相關的軟件包,這就是我記得可能會受到影響的一些軟件包。
我不得不AFER升級到Django的1.7同樣的問題,並解決它在運行中移除那些使用'manage.py' – cor 2014-10-31 13:35:33
的命令不適用於我,同樣的問題。 – giancarloap 2014-10-31 14:57:17
爲我做了,謝謝! – blissini 2014-12-01 20:51:54