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

Nick Coghlan ncoghlan at gmail.com
Tue Dec 9 10:01:17 CET 2008

Glenn Linderman wrote:
> On approximately 12/8/2008 9:30 AM, came the following characters from
> the keyboard of rdmurray at bitdance.com:
>> PS: I'd like to see a similar warning issued when an access attempt
>> is made through os.environ to a variable that cannot be decoded.
> And argv ?  Seems like the warning technique could be useful for _any_
> interface that has been traditionally bytes, because that's the kind of
> characters that were, but now should move to (Unicode) characters.
> The warnings could be the same, or very similar.
> The question is if one global control should handle all types of bytes
> problems, or if there should be individual controls for each bytes
> problem, or both.  I tend to believe in both; the paranoid can set
> exactly the ones they've coded for, the aggressive can set the global
> one.  In this manner, new cases can be added to the global settings over
> time, if more are discovered -- it should be documented to handle future
> similar issues in a similar manner.

The warnings system provides that level of granularity for 'free' (so
long as we set the stack level appropriately in the C-API warnings call).


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list