[Python-3000] python -S

Brett Cannon brett at python.org
Fri Aug 15 19:50:10 CEST 2008


On Fri, Aug 15, 2008 at 1:09 AM, Christian Heimes <lists at cheimes.de> wrote:
> Brett Cannon wrote:
>>
>> Speaking with my importlib hat on, I need a function that can easily
>> return the encoding of a file, so I have another legit use-case for
>> the functionality where exposing it through some built-in fashion
>> would be REALLY appreciated (I have one hacked together as
>> imp.source_open() in my bootstrapping work, but I still don't think it
>> is a very good solution).
>
> I've send you a patch.
>
>> Who is loading 'warnings'? If it something minor and very
>> startup-specific, perhaps using _warnings instead is a possibility.
>
> It's always loaded by Python/pythonrun.c
>

Really? Without really digging into the code too much I see that if
warnings were set on the command-line it's loaded, otherwise it's
skipped.

-Brett


More information about the Python-3000 mailing list