A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-December/030751.html below:

[Python-Dev] New and Improved Import Hooks

[Python-Dev] New and Improved Import Hooks [Python-Dev] New and Improved Import HooksFredrik Lundh fredrik@pythonware.com
Wed, 4 Dec 2002 23:42:14 +0100
Just van Rossum wrote:

> (I'd still like to see more examples of code breaking if a sys.path item isn't a
> string. Not that I don't believe it, but I'd like to get an impression of the
> severeness of the damage.)

>From the ImageFont module in PIL 1.1.3:

def load_path(filename):
    "Load a font file, searching along the Python path."
    for dir in sys.path:
        try:
            return load(os.path.join(dir, filename))
        except IOError:
            pass
    raise IOError, "cannot find font file"

(this is fixed in 1.1.4)

FWIW, I've done lots of stuff that scans sys.path directories for
various purposes.  It would probably be a good idea to use a string
subclass for the zip importer, but I don't think we need to make
stringness an absolute requirement.

Let's make it *really* easy to use zip archives, and reasonably easy
to use other custom importers.

</F>




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