Tryton - Issues

 

Issue5810

Title Client crash when user name on Windows has special character
Priority bug Status resolved
Superseder Nosy List ced, oscar, reviewbot, roundup-bot, semarie
Type crash Components tryton
Assigned To ced Keywords review
Reviews 38851002
View: 38851002

Created on 2016-08-21.16:32:15 by oscar, last changed by roundup-bot.

Messages
New changeset edbad8c577d5 by Cédric Krier in branch '4.4':
Decode path with file system encoding if it is not a unicode
http://hg.tryton.org/tryton/rev/edbad8c577d5

New changeset 6d2f8bd3d035 by Cédric Krier in branch '4.2':
Decode path with file system encoding if it is not a unicode
http://hg.tryton.org/tryton/rev/6d2f8bd3d035

New changeset 2bade618f35f by Cédric Krier in branch '4.0':
Decode path with file system encoding if it is not a unicode
http://hg.tryton.org/tryton/rev/2bade618f35f

New changeset d34e7c0b1beb by Cédric Krier in branch '3.8':
Decode path with file system encoding if it is not a unicode
http://hg.tryton.org/tryton/rev/d34e7c0b1beb

New changeset 213988c2f29d by Cédric Krier in branch '3.6':
Decode path with file system encoding if it is not a unicode
http://hg.tryton.org/tryton/rev/213988c2f29d
New changeset 8ec708476327 by Cédric Krier in branch 'default':
Decode path with file system encoding if it is not a unicode
http://hg.tryton.org/tryton/rev/8ec708476327
msg36179 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-10-10.09:59:15
It is confirming what I supposed that the APPDATA value is encoded in the file system encoding and not in UTF-8.
So for me, this test is enough to commit the fix.
msg36178 (view) Author: [hidden] (semarie) Date: 2017-10-10.06:56:15
I don't have a full developpement environment under Windows, so I couldn't test it with a patched tryton (I had installed tryton bundle to reproduce the issue).

but anyway, under a plain python 2.7 interpreter, I am able to reproduce it too. 

>>> os.path.join(os.environ['APPDATA'], u'.config', u'tryton')
generate utf-8 exception

>>> os.path.join(unicode(os.environ['APPDATA'], sys.getfilesystemencoding()), u'.config', u'tryton')
return valid unicode string

if a fully patched tryton is required for proper testing, I will need more time to install a complete developpement environment under Windows.
review38851002 updated at https://codereview.tryton.org/38851002/#ps1
msg36140 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-10-08.12:10:17
Here is review38851002 that should fix the problem.
msg36137 (view) Author: [hidden] (semarie) Date: 2017-10-08.06:55:12
Here a full backtrace (with 4.4.2 gtk-client).

Traceback (most recent call last):
  File "tryton/gui/main.py", line 851, in sig_login
  File "tryton/common/common.py", line 1093, in __init__
  File "tryton/gui/main.py", line 849, in <lambda>
  File "tryton/rpc.py", line 86, in login
  File "tryton/ipc.py", line 30, in __init__
  File "C:/building/msys64/mingw32/lib/python2.7/ntpath.py", line 98, in join
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 29: invalid continuation byte

The problem occurs right after gtk-client asked for password and server validate it.
msg27843 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2016-08-21.17:23:37
If it is easy, please provide the full traceback if you want to ease the job.
msg27841 (view) Author: [hidden] (oscar) (Tryton translator) Date: 2016-08-21.16:58:14
As I say dont have all traceback, but reproduce it is easy,

1. On windows create a new OS user Windows using on name 'ñ' and spaces, example:'carlos cataño'

2. Install tryton 4.0 with the user session

3. Try start Tryton client with this new user.
msg27839 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2016-08-21.16:41:01
We need the full traceback.
msg27837 (view) Author: [hidden] (oscar) (Tryton translator) Date: 2016-08-21.16:32:14
When user name on Windows OS has special character has "ñ" tryton client crash when user try start the login, example:

c:/users/my name with ñ/documents/...

This is traceback:
...
File "ntpath.pyc", line 85, in join
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 22: invalid...

the last part of the traceback is no visible because is a sended photo by user, sorry.
History
Date User Action Args
2017-10-17 21:01:43roundup-botsetmessages: + msg36347
2017-10-10 10:49:47roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg36180
2017-10-10 09:59:16cedsetmessages: + msg36179
2017-10-10 06:56:15semariesetmessages: + msg36178
2017-10-08 12:11:35reviewbotsetnosy: + reviewbot
messages: + msg36141
2017-10-08 12:10:17cedsetstatus: need-eg -> testing
keyword: + review
messages: + msg36140
component: + tryton
reviews: 38851002
assignedto: ced
2017-10-08 06:55:12semariesetnosy: + semarie
messages: + msg36137
2016-08-21 17:23:37cedsetmessages: + msg27843
2016-08-21 16:58:14oscarsetmessages: + msg27841
2016-08-21 16:41:01cedsetstatus: unread -> need-eg
nosy: + ced
messages: + msg27839

Showing 10 items. Show all history (warning: this could be VERY long)