#1185: Encoding problem with path of connection file
---------------------+------------------------------------------------------
Reporter: cito | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone: 0.8.3
Component: app | Version: 0.8.4
Resolution: | Keywords:
---------------------+------------------------------------------------------
Comment (by cito):
I have analyzed this problem a bit more. When supports_unicode_filenames
is True, this means that Python can output unicode filenames in certain
situations (e.g. in listdir(), when the input path is also unicode). But
normally, Python always uses encoded file names and paths (in whatever
encoding the file system supports, nowadays mostly utf-8). So we should
treat all file names as encoded already.
The problem arises because the filename of the connection file is read
from the cnxml file and thus comes in as unicode. In order to use this
as a filename and append this to encoded paths, this needs to be
encoded, and since there is no reasonable way to find out the encoding
of the file system, we must make a good guess, i.e. encode with utf-8.
So I think my original patch was in principle the right thing, but the
encoding should be done even earlier, see attached patch.
A problem can only appear when you use a connection file name with
non-ascii characters and the file system does not use utf-8, in which
case the file may not be found. But I think this problem can be
neglected, whereas without the patch you can get an exception even if
you use an ascii connection file.
--
Ticket URL: <http://trac.dabodev.com/ticket/1185#comment:3>
Dabo Trac <http://trac.dabodev.com>
Trac Page for Dabo
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]