Message194726
From: https://code.google.com/p/psutil/issues/detail?id=416
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os, errno
name = "ƒőő"
try:
os.mkdir(name)
except OSError as err:
if err.errno != errno.EEXIST:
raise
os.statvfs(name)
The script above works fine on Python 3.3 but on 2.7 you'll get:
Traceback (most recent call last):
File "foo.py", line 10, in <module>
os.statvfs(name)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)
Patch in attachment fixes the issue. |
|
Date |
User |
Action |
Args |
2013-08-09 12:06:43 | giampaolo.rodola | set | recipients:
+ giampaolo.rodola, ezio.melotti |
2013-08-09 12:06:43 | giampaolo.rodola | set | messageid: <1376050003.6.0.904056390722.issue18695@psf.upfronthosting.co.za> |
2013-08-09 12:06:43 | giampaolo.rodola | link | issue18695 messages |
2013-08-09 12:06:43 | giampaolo.rodola | create | |
|