I can avoid this by overwriting the container object in the above code with another 'get_container' call. But it seems like the code should just do the right thing when an object uploaded using an existing container.