[ python-Bugs-1541671 ] bsddb can't use unicode filenames
SourceForge.net
noreply at sourceforge.net
Fri Aug 18 09:18:11 CEST 2006
Bugs item #1541671, was opened at 2006-08-17 02:48
Message generated for change (Comment added) made by loewis
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1541671&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Zooko O'Whielacronx (zooko)
Assigned to: Nobody/Anonymous (nobody)
Summary: bsddb can't use unicode filenames
Initial Comment:
with Python 2.5b3,
Here is an attempt to use a unicode filename with bsddb:
>>> dbe = db.DBEnv()
>>> dbe.open(u'\u03b3\u03bb\u03ce\u03c3\u03c32',
db.DB_CREATE | db.DB_INIT_MPOOL)
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
range(128)
This is on Windows XP.
Here are some indications that the underlying SleepyCat
library ought to be able to do the right thing here:
http://www.sleepycat.com/xmldocs/ref/build_win/unicode.html
http://www.sleepycat.com/update/4.3.29/if.4.3.29.html
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2006-08-18 09:18
Message:
Logged In: YES
user_id=21627
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.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1541671&group_id=5470
More information about the Python-bugs-list
mailing list