Explicitly use __builtin__.open to avoid open() calling itself.
authorW. Trevor King <wking@drexel.edu>
Sat, 18 Feb 2012 20:55:03 +0000 (15:55 -0500)
committerW. Trevor King <wking@drexel.edu>
Sat, 18 Feb 2012 20:55:46 +0000 (15:55 -0500)
apachelog/file.py

index 5d0c95e5a01a6c8eea8cbdd93baa50e090bf62df..2f8076fa535c2009af445db829dfcc726547b89d 100644 (file)
@@ -1,3 +1,4 @@
+import __builtin__
 import gzip as _gzip
 import os.path as _os_path
 
@@ -26,5 +27,5 @@ def open(filename, openers=None):
     if openers is None:
         openers = OPENERS
     extension = _os_path.splitext(filename)[-1]
-    opener = openers.get(extension, open)
+    opener = openers.get(extension, __builtin__.open)
     return opener(filename, 'r')