Message194726
| Author |
giampaolo.rodola |
| Recipients |
ezio.melotti, giampaolo.rodola |
| Date |
2013年08月09日.12:06:43 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1376050003.6.0.904056390722.issue18695@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|