Commit 2242d941 authored by Julien Muchembled's avatar Julien Muchembled

Revert "Cache downloaded data in zc/buildout/buildout.py:_open() in memory to...

Revert "Cache downloaded data in zc/buildout/buildout.py:_open() in memory to accelerate remote extends."

This reverts commit 260bc0c4 partially.

The remaining should be squashed with "Write .installed.cfg only once, in safe way and only if there's any change."
parent 6b6ce0a1
...@@ -1813,7 +1813,6 @@ def _default_globals(): ...@@ -1813,7 +1813,6 @@ def _default_globals():
return globals_defs return globals_defs
_open_download_cache = {}
def _open(base, filename, seen, dl_options, override, downloaded): def _open(base, filename, seen, dl_options, override, downloaded):
"""Open a configuration file and return the result as a dictionary, """Open a configuration file and return the result as a dictionary,
...@@ -1843,14 +1842,8 @@ def _open(base, filename, seen, dl_options, override, downloaded): ...@@ -1843,14 +1842,8 @@ def _open(base, filename, seen, dl_options, override, downloaded):
base = os.path.dirname(filename) base = os.path.dirname(filename)
else: else:
filename = base + '/' + filename filename = base + '/' + filename
data = _open_download_cache.get(filename) downloaded_filename, is_temp = download(filename)
if data is None: fp = open(downloaded_filename)
downloaded_filename, is_temp = download(filename)
data = open(downloaded_filename).read()
_open_download_cache[filename] = data
else:
is_temp = False
fp = StringIO(data)
base = filename[:filename.rfind('/')] base = filename[:filename.rfind('/')]
else: else:
filename = os.path.join(base, filename) filename = os.path.join(base, filename)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment