Message97642
This is because in "path = join(os.getcwd(), path)" os.getcwd() returns a non-ascii byte string and path is unicode, so the cwd is implicitly decoded with the ascii codec in join and the error is raised.
Using getcwdu() when the path is unicode seems to fix the problem:
def abspath(path):
"""Return an absolute path."""
if not isabs(path):
- path = join(os.getcwd(), path)
+ if isinstance(path, unicode):
+ path = join(os.getcwdu(), path)
+ else:
+ path = join(os.getcwd(), path)
return normpath(path) |
|
Date |
User |
Action |
Args |
2010-01-12 18:16:10 | ezio.melotti | set | recipients:
+ ezio.melotti, flox |
2010-01-12 18:16:10 | ezio.melotti | set | messageid: <1263320170.37.0.237165132806.issue7669@psf.upfronthosting.co.za> |
2010-01-12 18:16:08 | ezio.melotti | link | issue7669 messages |
2010-01-12 18:16:08 | ezio.melotti | create | |
|