document management save file Error! 'ascii' codec can't decode byte 0xe9 in position 2: ordinal not in range(128)

Bug #333223 reported by GEM
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

ole,
configuration :windows xp sp3 all in one 5.0.0-3 french language, option don't hide extension file
with document management module (gestion des documents), when I want save a document, I do new, I select a file, but when I do save I have this error :
Error!
'ascii' codec can't decode byte 0xe9 in position 2: ordinal not in range(128)

solution here ?
http://effbot.org/pyfaq/what-does-unicodeerror-ascii-decoding-encoding-error-ordinal-not-in-range-128-mean.htm
A+

Revision history for this message
GEM (nimp3) wrote :

sorry I have forget to choose the good bug theme.

Revision history for this message
Paulino Ascenção (paulino.a) wrote :

See:
http://www.openobject.com/forum/topic9833.html

Open addons/document/document.py, find function random_name() replace "string.letters" with "string.ascii_letters"

string.letters's output depends on the platform. On Linux string.letters is the same as string.ascii_letters, but not on WinXP.

Revision history for this message
GEM (nimp3) wrote :

thanks, I have this another solution :
I have change in postgresql.conf
#client_encoding = sql_ascii
by
client_encoding = unicode(value, "ascii")
     except UnicodeError:
         value = unicode(value, "utf-8")
     else:
         pass#
I have restart server and client, and problem is solve
does this solution solve all similar problem we coulld retrieve in some other code python module ?
A+

Revision history for this message
GEM (nimp3) wrote :

sorry I have forgotten "try :" :
good code is
client_encoding = try :
unicode(value, "ascii")
     except UnicodeError:
         value = unicode(value, "utf-8")
     else:
         pass#

Revision history for this message
GEM (nimp3) wrote :

problem with the code that I have given, the server postgres don't start when I restart windows.
Everybody must use the solution given by Paulino :

Open addons/document/document.py, find function random_name() replace "string.letters" with "string.ascii_letters"

string.letters's output depends on the platform. On Linux string.letters is the same as string.ascii_letters, but not on WinXP.
A+

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

thank you, fix released.

Changed in openobject-client:
status: New → Fix Released
Revision history for this message
Rui Franco (multibase.pt) (rui-franco-multibase) wrote :

Sorry, old guys, but I do keep getting the same error. And I'm running both your solutions...

Revision history for this message
GEM (nimp3) wrote :

the final solution has been given by Paulino and Fabien :
you must do two things :
+ in ...\server\addons\document\document.py, find function random_name() replace "string.letters" with "string.ascii_letters"
+ delete the folder ...\server\filestore and create another one ...\server\filestore

Revision history for this message
GEM (nimp3) wrote : Re: [Bug 333223] Re: document management save file Error! 'ascii' codec can't decode byte 0xe9 in position 2: ordinal not in range(128)

the final solution has been given by Paulino and Fabien :
you must do two things :
+ in ...\server\addons\document\document.py, find function random_name() replace "string.letters" with "string.ascii_letters"
+ delete the folder ...\server\filestore and create another one ...\server\filestore
A+

> Message du 27/02/09 à 19h25
> De : "catinga" <email address hidden>
> A : <email address hidden>
> Copie à :
> Objet : [Bug 333223] Re: document management save file Error! 'ascii' codec can't decode byte 0xe9 in position 2: ordinal not in range(128)
>
>
> Sorry, old guys, but I do keep getting the same error. And I'm running
> both your solutions...
>
> --
> document management save file Error! 'ascii' codec can't decode byte 0xe9 in position 2: ordinal not in range(128)
> https://bugs.launchpad.net/bugs/333223
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in OpenObject Application Client - GTK: Fix Released
>
> Bug description:
> ole,
> configuration :windows xp sp3 all in one 5.0.0-3 french language, option don't hide extension file
> with document management module (gestion des documents), when I want save a document, I do new, I select a file, but when I do save I have this error :
> Error!
> 'ascii' codec can't decode byte 0xe9 in position 2: ordinal not in range(128)
>
> solution here ?
> http://effbot.org/pyfaq/what-does-unicodeerror-ascii-decoding-encoding-error-ordinal-not-in-range-128-mean.htm
> A+
>
>

____________________________________________________

 Trouvez des internautes qui partagent vos centres d'intérêt grâce à Voila ! http://tchat.voila.fr/

Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote :

New fix available

Changed in openobject-client:
status: Fix Released → New
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

Christophe, why did you reopened this bug ?
You still have a problem with the latest code ?

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

I think this bug is closed.

Changed in openobject-addons:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.