[Python-Dev] Relaxing Unicode error handling

Martin v. Loewis martin at v.loewis.de
Sun Jan 4 06:31:21 EST 2004


Phillip J. Eby wrote:

>> Is there any way to specify that implicit conversions raise an exception?
>> Perhaps by setting the default encoding to "undefined". 
> 
> 
> Gosh, that sure would have made my last i18n project go faster, and I'd 
> have had more confidence that I'd found all possible conversion issues.  

I don't know whether Neil was actually aware of that feature: In 
site.py, if you uncomment the block

if 0:
     # Enable to switch off string to Unicode coercion and implicit
     # Unicode to string conversion.
     encoding = "undefined"

you get precisely that.

Regards,
Martin




More information about the Python-Dev mailing list