A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2008-December/084163.html below:

[Python-Dev] Python-3.0, unicode, and os.environ

[Python-Dev] Python-3.0, unicode, and os.environAnders J. Munch ajm at flonidan.dk
Tue Dec 9 12:04:48 CET 2008
M.-A. Lemburg wrote:
> 
> Well, this is not too far away from just putting the whole decoding
> logic into the application directly:
> 
> files = [filename.decode(filesystemencoding, errors='warnreplace')
>          for filename in os.listdir(dir)]
> 
> (or os.listdirb() if that's where the discussion is heading)

I see what you mean, and yes, I think os.listdirb will do just as
well.  There is no need for any extra parameters to os.listdir.  The
typical application will just obliviously use os.listdir(dir) and get
the default elide-and-warn behaviour for un-decodable names.  That
rare special application that needs more control can use os.listdirb
and handle decoding itself.

Using a global registry of error handlers would just get in the way of
an application that needs more control.

- Anders
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4