Python bundles get purged after reloading endpoints

Hey,

Here are the logs written at the point of hot reloading the gateway.

time="Jun 18 21:25:32" level=info msg="Group reload accepted." status=ok
time="Jun 18 21:25:32" level=info msg="Reloaded URL Structure - Success"
time="Jun 18 21:25:32" level=warning msg="Insecure configuration detected (allowing)!"
time="Jun 18 21:25:32" level=info msg="Reloading endpoints"
time="Jun 18 21:25:32" level=info msg="Reload queued"
time="Jun 18 21:25:32" level=info msg="Initiating reload"
time="Jun 18 21:25:32" level=info msg="Loading policies"
time="Jun 18 21:25:32" level=error msg="Couldn't load policy file: read policies: is a directory"
time="Jun 18 21:25:32" level=info msg="Loading API Specification from /opt/tyk-gateway/apps/c8db77199c094c8847fce41a15e0e773.json"
time="Jun 18 21:25:32" level=info msg="Detected 1 APIs"
time="Jun 18 21:25:32" level=info msg="Preparing new router"
time="Jun 18 21:25:32" level=info msg="Initialising Tyk REST API Endpoints"
time="Jun 18 21:25:32" level=info msg="Loading API configurations."
time="Jun 18 21:25:32" level=info msg="Tracking hostname" api_name=Test domain="(no host)"
time="Jun 18 21:25:32" level=info msg="Loading API" api_name=Test
time="Jun 18 21:25:32" level=info msg="Loading existing bundle: authentication-1.0.2.zip"
time="Jun 18 21:25:32" level=info msg="----> Loading bundle: authentication-1.0.2.zip"
time="Jun 18 21:25:32" level=info msg="----> Using bundle: authentication-1.0.2.zip"
time="Jun 18 21:25:32" level=info msg="Checking security policy: Token" api_name=Test
time="Jun 18 21:25:33" level=info msg="Processed and listening on: /Test/{rest:.*}"
time="Jun 18 21:25:33" level=info msg="Loading uptime tests..."
time="Jun 18 21:25:33" level=info msg="Initialised API Definitions"
time="Jun 18 21:25:33" level=info msg="API reload complete"
time="Jun 18 21:25:33" level=info msg="Initiating coprocess reload"
time="Jun 18 21:25:33" level=info msg="Reloading middlewares"
time="Jun 18 21:25:33" level=info msg="Reloading event handlers and middlewares."
time="Jun 18 21:25:33" level=warning msg="Purging middleware: 'middleware'"

And this is what gets written when hitting the API after the reload.

time="Jun 18 21:26:13" level=error msg="Can't dispatch 'PostMiddleware', hook is not defined."

The new bundles filename had a point release bump between reloads and there was some changes made to the Post middleware but no files were added or removed from the bundle and the manifest.json did not change.

Cheers