Command 'makemessages' error
Question: I newbe in django and python. My project created under PyTools for Visual
Studio 2013. For localization I create 'locale' folder on manage.py level. And
I try run the following command:

.\ClarisPyEnv\Scripts\python.exe manage.py makemessages -l he

And I got the error:

    
    
    Exception in thread Thread-2377:
    Traceback (most recent call last):
      File "C:\Python34\lib\threading.py", line 921, in _bootstrap_inner
        self.run()
      File "C:\Python34\lib\threading.py", line 869, in run
        self._target(*self._args, **self._kwargs)
      File "C:\Python34\lib\subprocess.py", line 1170, in _readerthread
        buffer.append(fh.read())
      File "C:\Python34\lib\encodings\cp1255.py", line 23, in decode
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]
    UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 766: char
    acter maps to <undefined>
    
    Traceback (most recent call last):
      File "manage.py", line 17, in <module>
        execute_from_command_line(sys.argv)
      File "C:\Users\Alex\Documents\PythonProjects\ClarisPy\ClarisPy\ClarisPyEnv\lib
    \site-packages\django\core\management\__init__.py", line 385, in execute_from_co
    mmand_line
        utility.execute()
      File "C:\Users\Alex\Documents\PythonProjects\ClarisPy\ClarisPy\ClarisPyEnv\lib
    \site-packages\django\core\management\__init__.py", line 377, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "C:\Users\Alex\Documents\PythonProjects\ClarisPy\ClarisPy\ClarisPyEnv\lib
    \site-packages\django\core\management\base.py", line 288, in run_from_argv
        self.execute(*args, **options.__dict__)
      File "C:\Users\Alex\Documents\PythonProjects\ClarisPy\ClarisPy\ClarisPyEnv\lib
    \site-packages\django\core\management\base.py", line 338, in execute
        output = self.handle(*args, **options)
      File "C:\Users\Alex\Documents\PythonProjects\ClarisPy\ClarisPy\ClarisPyEnv\lib
    \site-packages\django\core\management\base.py", line 533, in handle
        return self.handle_noargs(**options)
      File "C:\Users\Alex\Documents\PythonProjects\ClarisPy\ClarisPy\ClarisPyEnv\lib
    \site-packages\django\core\management\commands\makemessages.py", line 290, in ha
    ndle_noargs
        self.write_po_file(potfile, locale)
      File "C:\Users\Alex\Documents\PythonProjects\ClarisPy\ClarisPy\ClarisPyEnv\lib
    \site-packages\django\core\management\commands\makemessages.py", line 402, in wr
    ite_po_file
        msgs, errors, status = popen_wrapper(args)
      File "C:\Users\Alex\Documents\PythonProjects\ClarisPy\ClarisPy\ClarisPyEnv\lib
    \site-packages\django\core\management\utils.py", line 25, in popen_wrapper
        output, errors = p.communicate()
      File "C:\Python34\lib\subprocess.py", line 959, in communicate
        stdout, stderr = self._communicate(input, endtime, timeout)
      File "C:\Python34\lib\subprocess.py", line 1234, in _communicate
        stdout = stdout[0]
    IndexError: list index out of range
    

What this means ? Where a problem? help me please!

Thank Alex


Answer: You dont need to specify unicode in pyhton 3. Unicode is default.

`from django.utils.translation import ugettext as _`

`_('חתול')`

Is enof for the translation and encoding to work.

