#21928: updating .po files with 'django-admin.py makemessages' under windows 
with
russian locale fail
-------------------------------------+-------------------------------------
     Reporter:  gurovic@…            |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:                       |                  Version:
  Internationalization               |  1.7-alpha-1
     Severity:  Release blocker      |               Resolution:
     Keywords:  encoding msgmerge    |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by aaugustin):

 * stage:  Unreviewed => Accepted


Old description:

> django1.7, python 3.2, windows 7 64 bit russian
>
> ---
> I have Windows 7 Rus, default encoding is cp1251.
> If i have some translations in .po-file in russian (utf-8 encoding),
> and running makemessages again to add new phrases, it uses msgmerge.exe
> in function write_po_file,
> popen got output in cp1251 encoding instead utf-8 and crashes:
>
> Exception in thread Thread-63:
> Traceback (most recent call last):
>   File "c:\python32\lib\threading.py", line 740, in _bootstrap_inner
>     self.run()
>   File "c:\python32\lib\threading.py", line 693, in run
>     self._target(*self._args, **self._kwargs)
>   File "c:\python32\lib\subprocess.py", line 1013, in _readerthread
>     buffer.append(fh.read())
>   File "c:\python32\lib\encodings\cp1251.py", line 23, in decode
>     return codecs.charmap_decode(input,self.errors,decoding_table)[0]
> UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position
> 1157: character maps to <undefined>
>
> Traceback (most recent call last):
>   File "c:\python32\Scripts\django-admin-script.py", line 9, in <module>
>     load_entry_point('Django==1.7a1', 'console_scripts', 'django-
> admin')()
>   File "c:\python32\lib\site-
> packages\django-1.7a1-py3.2.egg\django\core\management\__init__.py", line
> 427, in execute_from_command_line
>     utility.execute()
>   File "c:\python32\lib\site-
> packages\django-1.7a1-py3.2.egg\django\core\management\__init__.py", line
> 419, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "c:\python32\lib\site-
> packages\django-1.7a1-py3.2.egg\django\core\management\base.py", line
> 288, in run_from_argv
>     self.execute(*args, **options.__dict__)
>   File "c:\python32\lib\site-
> packages\django-1.7a1-py3.2.egg\django\core\management\base.py", line
> 337, in execute
>     output = self.handle(*args, **options)
>   File "c:\python32\lib\site-
> packages\django-1.7a1-py3.2.egg\django\core\management\base.py", line
> 529, in handle
>     return self.handle_noargs(**options)
>   File "c:\python32\lib\site-
> packages\django-1.7a1-py3.2.egg\django\core\management\commands\makemessages.py",
> line 288, in handle_noargs
>     self.write_po_file(potfile, locale)
>   File "c:\python32\lib\site-
> packages\django-1.7a1-py3.2.egg\django\core\management\commands\makemessages.py",
> line 399, in write_po_file
>     msgs, errors, status = popen_wrapper(args)
>   File "c:\python32\lib\site-
> packages\django-1.7a1-py3.2.egg\django\core\management\utils.py", line
> 25, in popen_wrapper
>     output, errors = p.communicate()
>   File "c:\python32\lib\subprocess.py", line 813, in communicate
>     return self._communicate(input)
>   File "c:\python32\lib\subprocess.py", line 1050, in _communicate
>     stdout = stdout[0]
> IndexError: list index out of range
>
> popen runs for the following process:
> ['msgmerge', '-q',
> 'C:\\temp\\oluch\\oluch\\locale\\ru\\LC_MESSAGES\\django.po',
> 'C:\\temp\\oluch\\oluch\\locale\\django.pot']

New description:

 django1.7, python 3.2, windows 7 64 bit russian

 ---
 I have Windows 7 Rus, default encoding is cp1251.
 If i have some translations in .po-file in russian (utf-8 encoding),
 and running makemessages again to add new phrases, it uses msgmerge.exe in
 function write_po_file,
 popen got output in cp1251 encoding instead utf-8 and crashes:

 {{{
 Exception in thread Thread-63:
 Traceback (most recent call last):
   File "c:\python32\lib\threading.py", line 740, in _bootstrap_inner
     self.run()
   File "c:\python32\lib\threading.py", line 693, in run
     self._target(*self._args, **self._kwargs)
   File "c:\python32\lib\subprocess.py", line 1013, in _readerthread
     buffer.append(fh.read())
   File "c:\python32\lib\encodings\cp1251.py", line 23, in decode
     return codecs.charmap_decode(input,self.errors,decoding_table)[0]
 UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position
 1157: character maps to <undefined>

 Traceback (most recent call last):
   File "c:\python32\Scripts\django-admin-script.py", line 9, in <module>
     load_entry_point('Django==1.7a1', 'console_scripts', 'django-admin')()
   File "c:\python32\lib\site-
 packages\django-1.7a1-py3.2.egg\django\core\management\__init__.py", line
 427, in execute_from_command_line
     utility.execute()
   File "c:\python32\lib\site-
 packages\django-1.7a1-py3.2.egg\django\core\management\__init__.py", line
 419, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "c:\python32\lib\site-
 packages\django-1.7a1-py3.2.egg\django\core\management\base.py", line 288,
 in run_from_argv
     self.execute(*args, **options.__dict__)
   File "c:\python32\lib\site-
 packages\django-1.7a1-py3.2.egg\django\core\management\base.py", line 337,
 in execute
     output = self.handle(*args, **options)
   File "c:\python32\lib\site-
 packages\django-1.7a1-py3.2.egg\django\core\management\base.py", line 529,
 in handle
     return self.handle_noargs(**options)
   File "c:\python32\lib\site-
 
packages\django-1.7a1-py3.2.egg\django\core\management\commands\makemessages.py",
 line 288, in handle_noargs
     self.write_po_file(potfile, locale)
   File "c:\python32\lib\site-
 
packages\django-1.7a1-py3.2.egg\django\core\management\commands\makemessages.py",
 line 399, in write_po_file
     msgs, errors, status = popen_wrapper(args)
   File "c:\python32\lib\site-
 packages\django-1.7a1-py3.2.egg\django\core\management\utils.py", line 25,
 in popen_wrapper
     output, errors = p.communicate()
   File "c:\python32\lib\subprocess.py", line 813, in communicate
     return self._communicate(input)
   File "c:\python32\lib\subprocess.py", line 1050, in _communicate
     stdout = stdout[0]
 IndexError: list index out of range
 }}}

 popen runs for the following process:

 {{{
 ['msgmerge', '-q',
 'C:\\temp\\oluch\\oluch\\locale\\ru\\LC_MESSAGES\\django.po',
 'C:\\temp\\oluch\\oluch\\locale\\django.pot']
 }}}

--

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/075.a27117f880df2383293a0b5ee8f03253%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to