Ticket #1371 (new defect)

Opened 1 year ago

ide modules fails to run on windows machines with cyrillic symbols in path to user directory

Reported by: Tatyr Assigned to:
Priority: major Milestone: 0.9.2
Component: ide Version: 0.9.1
Keywords: crash, encoding Cc:

Description

If a windows machine's current user's path to his/hers user directory contains cyrillic symbols (or maybe any non-ascii symbols) like a c:\Documents and Settings\Настя, then all ide modules (and demo modules too) crush during their launching with traceback of following kind (depends on module):

Traceback (most recent call last):
  File "E:\personal\develop\tests\ide\Editor.py", line 1090, in <module>
    main()
  File "E:\personal\develop\tests\ide\Editor.py", line 1073, in main
    app = dabo.dApp()
  File "c:\python27\lib\site-packages\dabo-0.9.2-py2.7.egg\dabo\dApp.py", line 206, in __init__
    self._frameworkPrefs = dabo.dPref(key="dabo_framework")
  File "c:\python27\lib\site-packages\dabo-0.9.2-py2.7.egg\dabo\dPref.py", line 78, in __init__
    forceCreate=True)
  File "c:\python27\lib\site-packages\dabo-0.9.2-py2.7.egg\dabo\db\dConnection.py", line 32, in __init__
    self._connection = self._openConnection(**kwargs)
  File "c:\python27\lib\site-packages\dabo-0.9.2-py2.7.egg\dabo\db\dConnection.py", line 77, in _openConnection
    return self._connectInfo.getConnection(forceCreate=self._forceCreate, **kwargs)
  File "c:\python27\lib\site-packages\dabo-0.9.2-py2.7.egg\dabo\db\dConnectInfo.py", line 105, in getConnection
    return self._backendObject.getConnection(self, **kwargs)
  File "c:\python27\lib\site-packages\dabo-0.9.2-py2.7.egg\dabo\db\dbSQLite.py", line 69, in getConnection
    self._connection = self.dbapi.connect(pth, factory=DictConnection, isolation_level=None)
  File "c:\python27\lib\site-packages\dabo-0.9.2-py2.7.egg\dabo\db\dbSQLite.py", line 49, in __init__
    dbapi.Connection.__init__(self, *args, **kwargs)
sqlite3.OperationalError: unable to open database file

As far as i can understand, main reason of such crashes is a wrong encoding given by dabo.fileSystemEncoding. In line 67 of dbSQLite module: pth = pth.decode(dabo.fileSystemEncoding).encode("utf-8"), valid unicode cyrillic letters in ptn variable is replaced by mess of foolish symbols. After commenting this line all modules run correctly.

And sorry for my english, it's not very good, i know.