]> granicus.if.org Git - python/commitdiff
Hack to avoid a nasty recursion issue when Python is invoked
authorGuido van Rossum <guido@python.org>
Thu, 9 Aug 2007 22:51:04 +0000 (22:51 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 9 Aug 2007 22:51:04 +0000 (22:51 +0000)
in verbose mode: pre-import the Latin-1 and UTF-8 codecs

Lib/site.py

index f7ca83b3805c9ab63de520c9d7eebef2759e02f1..1d3183af3ae3abd97f3781bf14cc773575582277 100644 (file)
@@ -405,6 +405,9 @@ def execsitecustomize():
 def installnewio():
     """Install new I/O library as default."""
     import io
+    # Hack to avoid a nasty recursion issue when Python is invoked
+    # in verbose mode: pre-import the Latin-1 and UTF-8 codecs
+    from encodings import latin_1, utf_8
     # Trick so that open won't become a bound method when stored
     # as a class variable (as dumbdbm does)
     class open: