Server raise exception when creating database in non-english
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Server (MOVED TO GITHUB) |
Fix Released
|
Undecided
|
Christophe Simonis (OpenERP) |
Bug Description
When creating database in ukrainian got error in ustr function
Revering bin/tools/misc.py to revision prior 1977 helps.
Related branches
Sharoon Thomas http://openlabs.co.in (sharoonthomas) wrote : | #1 |
Changed in openobject-server: | |
status: | New → Incomplete |
Ivan Gudym (igudym) wrote : | #2 |
[2010-02-20 11:56:26,099] INFO:i18n:module base: loading translation file for language uk_UA
[2010-02-20 11:56:26,721] ERROR:web-
[2010-02-20 11:56:26,722] ERROR:web-
[2010-02-20 11:56:26,722] ERROR:web-
[2010-02-20 11:56:26,722] ERROR:web-
[2010-02-20 11:56:26,722] ERROR:web-
[2010-02-20 11:56:26,723] ERROR:web-
[2010-02-20 11:56:26,723] ERROR:web-
[2010-02-20 11:56:26,723] ERROR:web-
[2010-02-20 11:56:26,723] ERROR:web-
[2010-02-20 11:56:26,724] ERROR:web-
[2010-02-20 11:56:26,724] ERROR:web-
[2010-02-20 11:56:26,724] ERROR:web-
[2010-02-20 11:56:26,724] ERROR:web-
[2010-02-20 11:56:26,725] ERROR:web-
[2010-02-20 11:56:26,725] ERROR:web-
[2010-02-20 11:56:26,725] ERROR:web-
[2010-02-20 11:56:26,725] ERROR:web-
[2010-02-20 11:56:26,726] ERROR:web-
[2010-02-20 11:56:26,726] ERROR:web-
[2010-02-20 11:56:26,726] ERROR:web-
[2010-02-20 11:56:26,726] ERROR:web-
[2010-02-20 11:56:26,727] ERROR:web-
[2010-02-20 11:56:26,727] ERROR:web-
[2010-02-20 11:56:26,727] ERROR:web-
[2010-02-20 11:56:26,727] ERROR:web-
[2010-02-20 11:56:26,728] ERROR:web-
[2010-02-20 11:56:26,728] ERROR:web-
[2010-02-20 11:56:26,728] ERROR:web-
[2010-02-20 11:56:26,728] ERROR:web-
[2010-02-20 11:56:26,729] ERROR:web-
Jay Vora (Serpent Consulting Services) (jayvora) wrote : | #3 |
I could not generate any such error with Ukranian Language.
I guess its the problem with py2.6.
Thanks.
Ivan Gudym (igudym) wrote : | #4 |
It's very strange.
I pull new copy of OpenERP into new location and try to create new database. Yes, I did it even on another box. Choose Language - Ukrainian, Load demonstration data - yes. And ... oops. The same error.
Ivan Gudym (igudym) wrote : | #5 |
[2010-02-22 11:37:44,826] INFO:i18n:module base: loading translation file for language uk_UA
[2010-02-22 11:37:49,240] ERROR:web-
[2010-02-22 11:37:49,240] ERROR:web-
[2010-02-22 11:37:49,241] ERROR:web-
[2010-02-22 11:37:49,241] ERROR:web-
[2010-02-22 11:37:49,241] ERROR:web-
[2010-02-22 11:37:49,241] ERROR:web-
[2010-02-22 11:37:49,242] ERROR:web-
[2010-02-22 11:37:49,242] ERROR:web-
[2010-02-22 11:37:49,242] ERROR:web-
[2010-02-22 11:37:49,242] ERROR:web-
[2010-02-22 11:37:49,243] ERROR:web-
[2010-02-22 11:37:49,243] ERROR:web-
[2010-02-22 11:37:49,243] ERROR:web-
[2010-02-22 11:37:49,243] ERROR:web-
[2010-02-22 11:37:49,244] ERROR:web-
[2010-02-22 11:37:49,244] ERROR:web-
[2010-02-22 11:37:49,244] ERROR:web-
[2010-02-22 11:37:49,245] ERROR:web-
[2010-02-22 11:37:49,245] ERROR:web-
[2010-02-22 11:37:49,245] ERROR:web-
[2010-02-22 11:37:49,245] ERROR:web-
[2010-02-22 11:37:49,246] ERROR:web-
[2010-02-22 11:37:49,246] ERROR:web-
[2010-02-22 11:37:49,246] ERROR:web-
[2010-02-22 11:37:49,246] ERROR:web-
[2010-02-22 11:37:49,247] ERROR:web-
[2010-02-22 11:37:49,247] ERROR:web-
[2010-02-22 11:37:49,247] ERROR:web-
[2010-02-22 11:37:49,247] ERROR:web-
[2010-02-22 11:37:49,248] ERROR:web-
Ivan Gudym (igudym) wrote : | #6 |
And, Jay, don't look to "DeprecationWar
Deprecation warning is just a result of incorrect (old-style) exception processing but not the reason of exception itself.
So this deprecation warning do not link together any bugs.
Parthiv Patel (parthiv-patel-deactivatedaccount) wrote : Re: [Bug 524588] Re: Server raise exception when creating database in non-english | #7 |
can you please tell what is the cluster / database encoding format ?
On Mon, Feb 22, 2010 at 3:17 PM, Ivan Gudym <email address hidden> wrote:
> *** This bug is a duplicate of bug 506427 ***
> https:/
>
> [2010-02-22 11:37:44,826] INFO:i18n:module base: loading translation file
> for language uk_UA
> [2010-02-22 11:37:49,240] ERROR:web-
> [2010-02-22 11:37:49,240] ERROR:web-
> :
> [2010-02-22 11:37:49,241] ERROR:web-
> Linux-2.
> [2010-02-22 11:37:49,241] ERROR:web-
> [2010-02-22 11:37:49,241] ERROR:web-
> :core-3.
> [2010-02-22 11:37:49,241] ERROR:web-
> Fedora
> [2010-02-22 11:37:49,242] ERROR:web-
> release 12 (Constantine)
> [2010-02-22 11:37:49,242] ERROR:web-
> [2010-02-22 11:37:49,242] ERROR:web-
> [2010-02-22 11:37:49,242] ERROR:web-
> : 2.6.31.
> [2010-02-22 11:37:49,243] ERROR:web-
> : #1 SMP Thu Feb 11 07:39:11 UTC 2010
> [2010-02-22 11:37:49,243] ERROR:web-
> Architecture : 32bit
> [2010-02-22 11:37:49,243] ERROR:web-
> : uk_UA.UTF8
> [2010-02-22 11:37:49,243] ERROR:web-
> [2010-02-22 11:37:49,244] ERROR:web-
> 5.0.7
> [2010-02-22 11:37:49,244] ERROR:web-
> 1982 <email address hidden>
> [2010-02-22 11:37:49,244] ERROR:web-
> [2010-02-22 11:37:49,245] ERROR:web-
> [2010-02-22 11:37:49,245] ERROR:web-
> call last):
> [2010-02-22 11:37:49,245] ERROR:web-
> "/home/
> 104, in __call__
> [2010-02-22 11:37:49,245] ERROR:web-
> modobj.
> [2010-02-22 11:37:49,246] ERROR:web-
> "/home/
> line 484, in update_translations
> [2010-02-22 11:37:49,246] ERROR:web-
> tools.trans_
> [2010-02-22 11:37:49,246] ERROR:web-
> "/home/
> trans_load
> [2010-02-22 11:37:49,246] ERROR:web-
> trans_load_
> verbose=verbose)
> [2010-02-22 11:37:49,247] ERROR:web-
> "/home/
> trans_load_data
> [2010-02-22 11:37:49,247] ERROR:web-
> uid, lang_info)
> ...
Stephane Wirtel (OpenERP) (stephane-openerp) wrote : | #8 |
I'm testing the Ukrainian Language with the current stable.
But I have an English environment.
Stephane Wirtel (OpenERP) (stephane-openerp) wrote : | #9 |
Hi,
I checked with python2.5 and python2.6
English Environment for the OS. but I just created the database with the Ukrainian language
Database Encoding: UTF-8
Conclusion: I can't reproduce your bug.
Can you provide complementary information about this bug ?
Thanks
Stephane Wirtel (OpenERP) (stephane-openerp) wrote : | #10 |
And what's your version ? Thanks
Ivan Gudym (igudym) wrote : | #11 |
Stephane, last version loaded by bzr_set, it printed in error log: [2010-02-22 11:37:49,244] ERROR:web-
Parthiv Patel (parthiv-patel-deactivatedaccount) wrote : | #12 |
I think Ivan Gudym is having Latin or some other database encoding than
UTF-8, that's why the problem occurs.
On Mon, Feb 22, 2010 at 3:40 PM, Stephane (Open ERP) <email address hidden>wrote:
> And what's your version ? Thanks
>
> --
> Server raise exception when creating database in non-english
> https:/
> You received this bug notification because you are subscribed to
> OpenObject Server.
>
> Status in OpenObject Server: Incomplete
>
> Bug description:
> When creating database in ukrainian got error in ustr function
> Revering bin/tools/misc.py to revision prior 1977 helps.
>
>
>
--
Thanks & Regards,
Parthiv Patel
Ivan Gudym (igudym) wrote : | #13 |
$ locale
LANG=uk_UA.UTF-8
LC_CTYPE=
LC_NUMERIC=
LC_TIME=
LC_COLLATE=
LC_MONETARY=
LC_MESSAGES=
LC_PAPER=
LC_NAME=
LC_ADDRESS=
LC_TELEPHONE=
LC_MEASUREMENT=
LC_IDENTIFICATI
LC_ALL=
Ivan Gudym (igudym) wrote : | #14 |
bzr branch lp:openerp
cd openerp
./bzr_set.py
Parthiv Patel (parthiv-patel-deactivatedaccount) wrote : | #15 |
can you please tell us what is the out put of this command :
psql -l
please paste the output of the command.
Regards,
Parthiv
Sharoon Thomas http://openlabs.co.in (sharoonthomas) wrote : | #16 |
To debug this, can you insert the following lines in the function : (Its in bin/tools/misc.py line720)
def ustr(value):
insert a print,
print "Try to make unicode string:", value, type(value)
and paste the stack trace here
Ivan Gudym (igudym) wrote : | #17 |
Name | Owner | Encoding | Collation | Ctype | Access privileges
-------
exp | openerp | UTF8 | uk_UA.UTF-8 | uk_UA.UTF-8 |
postgres | postgres | UTF8 | uk_UA.UTF-8 | uk_UA.UTF-8 |
qqq | openerp | UTF8 | uk_UA.UTF-8 | uk_UA.UTF-8 |
template0 | postgres | UTF8 | uk_UA.UTF-8 | uk_UA.UTF-8 | =c/postgres
template1 | postgres | UTF8 | uk_UA.UTF-8 | uk_UA.UTF-8 | =c/postgres
tmp0 | openerp | UTF8 | uk_UA.UTF-8 | uk_UA.UTF-8 |
tmp1 | openerp | UTF8 | uk_UA.UTF-8 | uk_UA.UTF-8 |
tmp2 | openerp | UTF8 | uk_UA.UTF-8 | uk_UA.UTF-8 |
tmp3 | openerp | UTF8 | uk_UA.UTF-8 | uk_UA.UTF-8 |
tmp4 | openerp | UTF8 | uk_UA.UTF-8 | uk_UA.UTF-8 |
tmp5 | openerp | UTF8 | uk_UA.UTF-8 | uk_UA.UTF-8 |
tmp6 | openerp | UTF8 | uk_UA.UTF-8 | uk_UA.UTF-8 |
tmp7 | openerp | UTF8 | uk_UA.UTF-8 | uk_UA.UTF-8 |
tmp8 | openerp | UTF8 | uk_UA.UTF-8 | uk_UA.UTF-8 |
tmp9 | openerp | UTF8 | uk_UA.UTF-8 | uk_UA.UTF-8 |
Ivan Gudym (igudym) wrote : | #18 |
Corresponding part of my postgresql.conf
# - Locale and Formatting -
datestyle = 'iso, dmy'
#intervalstyle = 'postgres'
#timezone = unknown<
<------
#timezone_
<------
<------
<------
<------
<------
<------
#extra_float_digits = 0><------><------># min -15, max 2
#client_encoding = sql_ascii<
<------
# These settings are initialized by initdb, but they can be changed.
lc_messages = 'uk_UA.
<------
lc_monetary = 'uk_UA.
lc_numeric = 'uk_UA.
lc_time = 'uk_UA.
# default configuration for text search
default_
Ivan Gudym (igudym) wrote : | #19 |
Sorry
# - Locale and Formatting -
datestyle = 'iso, dmy'
#intervalstyle = 'postgres'
#timezone = unknown # actually, defaults to TZ environment
#timezone_
#extra_float_digits = 0 # min -15, max 2
#client_encoding = sql_ascii # actually, defaults to database
# These settings are initialized by initdb, but they can be changed.
lc_messages = 'uk_UA.UTF-8' # locale for system error message
lc_monetary = 'uk_UA.UTF-8' # locale for monetary formatting
lc_numeric = 'uk_UA.UTF-8' # locale for number formatting
lc_time = 'uk_UA.UTF-8' # locale for time formatting
Sharoon Thomas http://openlabs.co.in (sharoonthomas) wrote : | #20 |
This is not a database error.
Its trying to translate a value and after the recent refactoring which introduced get_encodings, you are missing an else in line 710
Changed in openobject-server: | |
status: | Incomplete → Confirmed |
Ivan Gudym (igudym) wrote : | #21 |
Good.
I set system locale to en_US and got the same error.
Stephane Wirtel (OpenERP) (stephane-openerp) wrote : | #22 |
Sharoon,
Can you provide a fix ?
Thanks
Christophe Simonis (OpenERP) (kangol) wrote : | #23 |
@Sharoon:
No, no need to put a else at line 710.
@Ivan:
Can you post us the result of the following command ?
$> python -c "import locale;print locale.
Sharoon Thomas http://openlabs.co.in (sharoonthomas) wrote : | #24 |
@Christophe,
The concern is it returns a None type and .lower() dows not exist for None type.
Lets wait for Ivan to respond and that should help solve the issue.
We need an else case where the getpreferredenc
Ivan Gudym (igudym) wrote : | #25 |
$ python -c "import locale;print locale.
UTF-8
Ivan Gudym (igudym) wrote : | #26 |
@Christophe - What's next?
Sharoon Thomas http://openlabs.co.in (sharoonthomas) wrote : | #27 |
I am keen to know what is that magic term which does not become unicode.
Can you put these two lines in the beggining of your function ustr.
(Insert in line)
print "Try to make unicode string:", value, type(value)
and then paste it here
Looks like the character is �
But keen to know where it came from
Ivan Gudym (igudym) wrote : | #28 |
[2010-02-23 12:06:50,110] INFO:i18n:module base: loading translation file for language uk_UA
Try to make unicode string: <type 'str'> Connection
Try to make unicode string: <type 'str'> create cursor to "aaa"
Try to make unicode string: <type 'str'> ConnectionPool
Try to make unicode string: <type 'str'> ConnectionPool(
Try to make unicode string: <type 'str'> ConnectionPool
Try to make unicode string: <type 'str'> Borrow connection to user=postgres dbname=aaa
Try to make unicode string: <type 'str'> ConnectionPool
Try to make unicode string: <type 'str'> ConnectionPool(
Try to make unicode string: <type 'str'> ConnectionPool
Try to make unicode string: <type 'str'> Create new connection
Try to make unicode string: <type 'str'> uk_UA
Try to make unicode string: <type 'str'> %d.%m.%Y
Try to make unicode string: <type 'str'> uk_UA
Try to make unicode string: <type 'unicode'> Ukrainian / украї́нська мо́ва
Try to make unicode string: <type 'str'> �
exception 1
exception 2 utf8
exception 2 UTF-8
Try to make unicode string: <type 'str'> web-services
Try to make unicode string: <type 'str'> CREATE DATABASE
Traceback (most recent call last):
File "/home/
modobj.
File "/home/
tools.
File "/home/
r = trans_load_
File "/home/
lang_
File "/home/
upd2.
File "/home/
u_symb = tools.ustr(symb)
File "/home/
raise UnicodeError(
UnicodeError: unable de to convert '\xc2\xc2\xa0'
Ivan Gudym (igudym) wrote : | #29 |
def ustr(value):
"""This method is similar to the builtin `str` method, except
it will return Unicode string.
@param value: the value to convert
@rtype: unicode
@return: unicode string
"""
print "Try to make unicode string:", type(value), value
orig = value
if isinstance(value, Exception):
return exception_
if isinstance(value, unicode):
return value
try:
return unicode(value)
except:
print "exception 1"
pass
for ln in get_encodings():
try:
return unicode(value, ln)
except:
print "exception 2", ln
pass
raise UnicodeError(
Ivan Gudym (igudym) wrote : | #30 |
orm.py:
for field in vals:
if field in self._columns:
if self._columns[
2765 print vals, field
Ivan Gudym (igudym) wrote : | #31 |
Try to make unicode string: <type 'unicode'> Ukrainian / украї́нська мо́ва
{'date_format': '%d.%m.%Y', 'direction': 'ltr', 'code': 'uk_UA', 'name': u'Ukrainian / \u0443\
Try to make unicode string: <type 'str'> �
exception 1
exception 2 utf8
exception 2 UTF-8
Ivan Gudym (igudym) wrote : | #32 |
Look at: 'thousands_sep': '\xc2\xc2\xa0'
Sharoon Thomas http://openlabs.co.in (sharoonthomas) wrote : | #33 |
So,
My guess was right :-)
'�' is the problem.
Changed in openobject-server: | |
status: | Confirmed → Triaged |
Ivan Gudym (igudym) wrote : | #34 |
Here interere two bugs.
1. First - bug in ustr, which was introduced in 1977 revision of misc.py
2. Second - bug in translate.py, which set thousand separator to strange symbol while it should be plane space " "
I can't understand this magic of translate.py:
What is '\xc2\xa0'?
Christophe Simonis (OpenERP) (kangol) wrote : | #35 |
In fact the bug is in translate.py at lines 660 and 661
Changed in openobject-server: | |
assignee: | nobody → Christophe (OpenERP) (kangol) |
Ivan Gudym (igudym) wrote : | #36 |
Look at http://
Ivan Gudym (igudym) wrote : | #37 |
This strange "replace" was moved by Stephane Wirtel from fields.py to translate.py in revision 1705.
There it was first introduced by himself in revision 1703.
Christophe Simonis (OpenERP) (kangol) wrote : | #38 |
Fixed by <email address hidden>
Changed in openobject-server: | |
status: | Triaged → Fix Released |
milestone: | none → 5.0.7 |
Can you paste your stack trace?