Martin v. Löwis wrote: >> - If people were somehow relying on sys not having an attribute called >> _setdefaultencoding, or were relying on stuffing an attribute into sys >> called _setdefaultencoding then... well... that seems pretty unlikely ;-) > > If people were using the reload trickery, that would break if the > function changed its name. No it doesn't: $ svn diff Index: Lib/site.py =================================================================== --- Lib/site.py (revision 74552) +++ Lib/site.py (working copy) @@ -540,6 +540,7 @@ if hasattr(sys, "setdefaultencoding"): + sys._setdefaultencoding = sys.setdefaultencoding del sys.setdefaultencoding >>> import sys >>> sys._setdefaultencoding <built-in function setdefaultencoding> >>> sys.setdefaultencoding Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'setdefaultencoding' >>> reload(sys) <module 'sys' (built-in)> >>> sys.setdefaultencoding <built-in function setdefaultencoding> >>> sys._setdefaultencoding <built-in function setdefaultencoding> Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk
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