minio-py icon indicating copy to clipboard operation
minio-py copied to clipboard

pathlib object support

Open Ernaldis opened this issue 2 years ago • 1 comments

When I was using your tool earlier, I was calling the functions fput_object and fget_object with identical parameters set. I was confused to find I got the error TypeError: unsupported operand type(s) for +: 'PosixPath' and 'str' when downloading, but not uploading.

I eventually realized the issue was that I was using a pathlib object for the parameter file_path. It appears that fput_object supports the use of pathlib objects, but fget_object does not.

Casting the file path to a string made the code work, but I think it would be a nice feature to add support for pathlib objects to fget_object as well.

Ernaldis avatar Jul 20 '22 22:07 Ernaldis

Please feel free to send a PR

balamurugana avatar Jul 21 '22 02:07 balamurugana