This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: bsddb can't use unicode filenames
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: loewis, zooko
Priority: low Keywords:

Created on 2006-08-17 00:48 by zooko, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg60973 - (view) Author: Zooko O'Whielacronx (zooko) Date: 2006-08-17 00:48
with Python 2.5b3,

Here is an attempt to use a unicode filename with bsddb:

>>> dbe = db.DBEnv()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
__builtin__.UnicodeEncodeError: 'ascii' codec can't
encode characters in position 0-4: ordinal not in

This is on Windows XP.

Here are some indications that the underlying SleepyCat
library ought to be able to do the right thing here:

msg60974 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-08-18 07:18
Logged In: YES 

The sleepycat Unicode build procedure is not usable for
Python. The exposed API (db_open) etc. still operates on
char* strings. It then internally decodes them to WCHAR_T
before passing them to the Win32 API. Why they do this is
beyond me; I can't see any advantage in doing so (for the
users of the library, nothing changes).

It would be possible to change _bsddb to encode Unicode
strings automatically with the "mbcs" codec. Not sure
whether that would help in your case, as I don't know what
the system ANSI code page on your installation is.
Date User Action Args
2022-04-11 14:56:19adminsetgithub: 43840
2008-01-23 07:26:49gregory.p.smithsetstatus: open -> closed
priority: normal -> low
resolution: wont fix
2006-08-17 00:48:58zookocreate