Pass file object to Tarfile.addfile()
Pass file object to Tarfile.addfile()

This resolves an issue where TarFile.gettarinfo() doesn't include the
file object, meaning that TarFile.addfile(TarFile.gettarinfo()) doesn't
pass the test suite. Instead, this uses an open() within a try...except
block to include a file object for each file without passing a file
object when the path is a directory.

Signed-off-by: Christian Bundy <f24b98133636c2132d1a3ca696ddfe180b0ad033@fraction.io>

dimaspivak/docker-py,bfirsh/docker-py,funkyfuture/docker-py,kaiyou/docker-py,kaiyou/docker-py,funkyfuture/docker-py,dimaspivak/docker-py,docker/docker-py,docker/docker-py,youhong316/docker-py,vdemeester/docker-py,vpetersson/docker-py,auready/docker-py,vdemeester/docker-py,youhong316/docker-py,auready/docker-py,bfirsh/docker-py,vpetersson/docker-py