os.path.expanduser on Windows: UnicodeEncodeError

B

Bob Swerdlow

My application is getting this error on Windows XP (works fine on Mac OS X)
when it calls os.path.expanduser:
UnicodeEncodeError: 'ascii' codec can't encode characters in position
52-56: ordinal not in range(128)

The code was built with Python 2.3.4.

I found referenes to Path 957650, but I'm not familiar with how such fixes
are processed. Is there a patch I can add to fix this? How do I know what
version of Python it is fixed in - that is, will upgrading to Python 2.3.5
fix this?

Thanks for your help,

Bob Swerdlow
VP Engineering
Goombah - Music Discovery
(e-mail address removed)
 
N

Neil Hodgson

Bob said:
My application is getting this error on Windows XP (works fine on Mac OS
X) when it calls os.path.expanduser:
UnicodeEncodeError: 'ascii' codec can't encode characters in position
52-56: ordinal not in range(128)

What does your environment look like? You can find out by typing
"SET" at a command prompt. The settings used are HOME, HOMEPATH and
HOMEDRIVE. Also helpful to print out the value being handed to
os.path.expanduser.
I found referenes to Path 957650, but I'm not familiar with how such
fixes are processed. Is there a patch I can add to fix this? How do I
know what version of Python it is fixed in - that is, will upgrading to
Python 2.3.5 fix this?

The patch is still "Status: Open" so hasn't been applied to a
release. It is not certain that this will fix your problem. The main
benefit of the patch appears to be IMO that it will use the standard
USERPROFILE environment variable.

Neil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top