This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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:43giampaolo.rodolasetrecipients: + giampaolo.rodola, ezio.melotti
2013-08-09 12:06:43giampaolo.rodolasetmessageid: <1376050003.6.0.904056390722.issue18695@psf.upfronthosting.co.za>
2013-08-09 12:06:43giampaolo.rodolalinkissue18695 messages
2013-08-09 12:06:43giampaolo.rodolacreate