[IPython-dev] IPython and unicode (planning ahead for Py3k)

Robert Kern robert.kern@gmail....
Wed Nov 11 18:46:30 CST 2009

On 2009-11-11 18:29 PM, Brian Granger wrote:

> * Starting now, every path, filename, etc should be unicode?  I am not
> as sure about this one...
> The Python 3 docs here:
> http://docs.python.org/3.1/library/os.path.html
> say the most general thing is to use bytes on unix/linux/os x and
> unicode on Windows for paths,
> files, dirs.  That seems like a huge pain though and would mean we have
> to provide some sort
> of abstraction layer for these things.  It would be so nice to simply
> use unicode everywhere.
> But, that means there are some paths that we can't represent on unix.

These should be enormously rare, I think. By and large, we are mostly concerned 
with representing ~/, right? I think it is reasonable to only support (encoded) 
Unicode file paths and not support *completely* arbitrary file paths. I doubt we 
will get a single bug report.

Also, perhaps it's not worth noting, but OS X appears to require UTF-8 encoding 
of filenames. I.e., one should use unicode strings in Python to represent them.

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

More information about the IPython-dev mailing list