From 91cbc161f4192f2146e7345a06c4fe1e9da21970 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Thu, 19 Nov 2020 22:45:07 +0200 Subject: [PATCH] Fix infinite recursion in StorageManager upload. Issue #253 --- trains/storage/helper.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/trains/storage/helper.py b/trains/storage/helper.py index dd520bb5..277dcf86 100644 --- a/trains/storage/helper.py +++ b/trains/storage/helper.py @@ -567,9 +567,13 @@ class StorageHelper(object): dest_path = self._canonize_url(dest_path) if cb and self.scheme in _HttpDriver.schemes: + # store original callback + a_cb = cb + # quote link - def callback(path): - return cb(quote_url(path) if path else path) + def callback(a_path): + return a_cb(quote_url(a_path) if a_path else a_path) + # replace callback with wrapper cb = callback if async_enable: