This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[1.7] codepage:utf removal and python


I came across a problem today with Cygwin 1.7 while using rdiff-backup, which is a Python program. I have a directory with a file having a non-ASCII character in the name. rdiff-backup was unable to backup that directory.

When codepage:utf was supported, this worked fine. Now, it fails, even when I have LANG=en_US.UTF-8 in my environment. It all boils down to this python code:

  import os
  os.listdir('.')

(That's an example I run from within the directory.) This fails with an error

OSError: [Errno 138] Invalid or incomplete multibyte or wide character: '.'

unless one does this first:

  import locale
  locale.setlocale(locale.LC_ALL, '')

I've patched rdiff-backup to do this, but I'm still wondering if this is the correct thing to do. I know that on my Linux machine, I don't have to do this, but I'm not sure if that's because there's some default locale that's being picked up by Python from somewhere other than the environment.

To sum it up: Is this a bad unintended consequence of removing codepage:utf?

--
David Rothenberger  ----  daveroth@acm.org

Truthful, adj.:
        Dumb and illiterate.
                -- Ambrose Bierce, "The Devil's Dictionary"


-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]