Message31537
mkdtemp fails miserably on Windows if Windows user name has any non-ASCII characters, like ä or ö, in it. mkdtemp throws an encoding error.
This seems to be because the default temp dir in Windows is "c:\documents and settings\<user name>\local settings\temp". Now if the user name has non-ASCII characters ASCII decoder cannot handle it and creating temp directories won't work.
As a work around I have used the following code:
tempdir = unicode(tempfile.gettempdir(), 'mbcs')
mkdtemp(suffix='foo', dir=tempdir)
This applies for both Python 2.4 and Python 2.5. |
|
Date |
User |
Action |
Args |
2007-08-23 14:52:31 | admin | link | issue1681974 messages |
2007-08-23 14:52:31 | admin | create | |
|