non-ascii character in the path of messages.dat #165

Open
opened 2013-05-25 17:55:39 +02:00 by tyrylu · 4 comments
tyrylu commented 2013-05-25 17:55:39 +02:00 (Migrated from github.com)

Hello,
when you are determining the appdata path on windows, you get the value in whatever encoding windows chooses, which then results in an OperationalError during db connection opening. It would be useful to decode it to an unicode string, perhaps using sys.getfilesystemencoding. And it would help to have the whole logic only in shared, not duplicated it in the main script. Or is there any difference?

Hello, when you are determining the appdata path on windows, you get the value in whatever encoding windows chooses, which then results in an OperationalError during db connection opening. It would be useful to decode it to an unicode string, perhaps using sys.getfilesystemencoding. And it would help to have the whole logic only in shared, not duplicated it in the main script. Or is there any difference?
AyrA commented 2013-06-06 12:51:06 +02:00 (Migrated from github.com)

windows uses unicode since Windows NT. GetFileSystemEncoding sometimes returns mbcs on Windows even if it is unicode:
http://docs.python.org/2/library/sys.html#sys.getfilesystemencoding

windows uses unicode since Windows NT. GetFileSystemEncoding sometimes returns mbcs on Windows even if it is unicode: http://docs.python.org/2/library/sys.html#sys.getfilesystemencoding
tyrylu commented 2013-06-07 10:55:16 +02:00 (Migrated from github.com)

Yeach, they do that internally. Perhaps there is better way of getting the user's appdata path?

Yeach, they do that internally. Perhaps there is better way of getting the user's appdata path?
AyrA commented 2013-06-07 21:17:30 +02:00 (Migrated from github.com)

You can use the environment variable %APPDATA% on windows, or check if the platform is windows NT and just "assume" UTF-8.

You can use the environment variable %APPDATA% on windows, or check if the platform is windows NT and just "assume" UTF-8.
PeterSurda commented 2016-04-28 15:32:57 +02:00 (Migrated from github.com)

Is this still a problem?

Is this still a problem?
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Bitmessage/PyBitmessage-2024-12-16#165
No description provided.