Python 3.0 Internationalization msgfmt.py on windows XP: TypeError: can't concat bytes to str

"DIVINE PAUL" <[email protected]> Fri, 17 Apr 2009 16:20:06 +0200
Newsgroups gmane.comp.python.internationalization
Message-ID <E84C901545FD2B4BB4A6E07C2C544D8F0380BCCD@FRVELSMBS14.ad2.ad.alcatel.com>
This is a multi-part message in MIME format.

--===============0217526850==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C9BF67.9BAB3064"

This is a multi-part message in MIME format.

------_=_NextPart_001_01C9BF67.9BAB3064
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi,

The file

C:\wamp\www\paul\essais\multilingueapp\locale\fr\LC_MESSAGES\multilingue
app.po

contains

# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2009-04-17 10:08+Romance Daylight Time\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: fr <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=3DCHARSET\n"
"Content-Transfer-Encoding: ENCODING\n"
"Generated-By: pygettext.py 1.5\n"


#: C:\wamp\www\paul\essais\multilingueapp\multlingueapp.py:85
msgid "albatross"
msgstr "albatrosse"

#: C:\wamp\www\paul\essais\multilingueapp\multlingueapp.py:85
msgid "mollusk"
msgstr "mollosque"

#: C:\wamp\www\paul\essais\multilingueapp\multlingueapp.py:85
msgid "python"
msgstr "python"

#: C:\wamp\www\paul\essais\multilingueapp\multlingueapp.py:85
msgid "rat"
msgstr "python"



The script msgfmt.py has the following result


C:\wamp\www\paul\essais\multilingueapp\locale\fr\LC_MESSAGES>c:\python30
\python C:\Python30\Tools\i18n\msgfmt.py multilingueapp.po
Traceback (most recent call last):
  File "C:\Python30\Tools\i18n\msgfmt.py", line 202, in <module>
    main()
  File "C:\Python30\Tools\i18n\msgfmt.py", line 198, in main
    make(filename, outfile)
  File "C:\Python30\Tools\i18n\msgfmt.py", line 165, in make
    output =3D generate()
  File "C:\Python30\Tools\i18n\msgfmt.py", line 92, in generate
    output +=3D ids
TypeError: can't concat bytes to str


What's wrong?

Where to find a complete example of internationalization, with change of
lang on the fly.

In advance, thanks for your help.
Paul

------_=_NextPart_001_01C9BF67.9BAB3064
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.5.7652.24">
<TITLE>Python 3.0 Internationalization msgfmt.py on windows XP: =
TypeError: can't concat bytes to str</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=3D2 FACE=3D"Arial">Hi,</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">The file</FONT>
</P>

<P><FONT SIZE=3D2 =
FACE=3D"Arial">C:\wamp\www\paul\essais\multilingueapp\locale\fr\LC_MESSAG=
ES\multilingueapp.po</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">contains</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial"># SOME DESCRIPTIVE TITLE.</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial"># Copyright (C) YEAR =
ORGANIZATION</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial"># FIRST AUTHOR &lt;EMAIL@ADDRESS&gt;, =
YEAR.</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">#</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">msgid &quot;&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">msgstr &quot;&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&quot;Project-Id-Version: PACKAGE =
VERSION\n&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&quot;POT-Creation-Date: 2009-04-17 =
10:08+Romance Daylight Time\n&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&quot;PO-Revision-Date: YEAR-MO-DA =
HO:MI+ZONE\n&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&quot;Last-Translator: FULL NAME =
&lt;EMAIL@ADDRESS&gt;\n&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&quot;Language-Team: fr =
&lt;[email protected]&gt;\n&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&quot;MIME-Version: 1.0\n&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&quot;Content-Type: text/plain; =
charset=3DCHARSET\n&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&quot;Content-Transfer-Encoding: =
ENCODING\n&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&quot;Generated-By: pygettext.py =
1.5\n&quot;</FONT>
</P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Arial">#: =
C:\wamp\www\paul\essais\multilingueapp\multlingueapp.py:85</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">msgid &quot;albatross&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">msgstr &quot;albatrosse&quot;</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">#: =
C:\wamp\www\paul\essais\multilingueapp\multlingueapp.py:85</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">msgid &quot;mollusk&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">msgstr &quot;mollosque&quot;</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">#: =
C:\wamp\www\paul\essais\multilingueapp\multlingueapp.py:85</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">msgid &quot;python&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">msgstr &quot;python&quot;</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">#: =
C:\wamp\www\paul\essais\multilingueapp\multlingueapp.py:85</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">msgid &quot;rat&quot;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">msgstr &quot;python&quot;</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Arial">The script msgfmt.py has the following =
result</FONT>
</P>
<BR>

<P><FONT SIZE=3D2 =
FACE=3D"Arial">C:\wamp\www\paul\essais\multilingueapp\locale\fr\LC_MESSAG=
ES&gt;c:\python30\python C:\Python30\Tools\i18n\msgfmt.py =
multilingueapp.po</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Traceback (most recent call =
last):</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; File =
&quot;C:\Python30\Tools\i18n\msgfmt.py&quot;, line 202, in =
&lt;module&gt;</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; main()</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; File =
&quot;C:\Python30\Tools\i18n\msgfmt.py&quot;, line 198, in main</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; make(filename, =
outfile)</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; File =
&quot;C:\Python30\Tools\i18n\msgfmt.py&quot;, line 165, in make</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; output =3D =
generate()</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp; File =
&quot;C:\Python30\Tools\i18n\msgfmt.py&quot;, line 92, in =
generate</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">&nbsp;&nbsp;&nbsp; output +=3D =
ids</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">TypeError: can't concat bytes to =
str</FONT>
</P>
<BR>

<P><FONT SIZE=3D2 FACE=3D"Arial">What's wrong?</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Where to find a complete example of =
internationalization, with change of lang on the fly.</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">In advance, thanks for your =
help.</FONT>

<BR><FONT SIZE=3D2 FACE=3D"Arial">Paul</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C9BF67.9BAB3064--

--===============0217526850==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
I18n-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/i18n-sig

--===============0217526850==--