piskvorky / smart_open

Utils for streaming large files (S3, HDFS, gzip, bz2...)
MIT License
3.18k stars 383 forks source link

Fix __str__ method in SinglepartWriter #791

Closed ThosRTanner closed 7 months ago

ThosRTanner commented 10 months ago

Title

Fix str method in SinglepartWriter

Motivation

The bug here means that whenever you open an s3 connection and switch multipart writing off because the file is small, although the write completes successfully, you get an exception thrown when the code logs a debug message saying it has finished. This makes it look like your transfer has failed.

Tests

Added test

Checklist

Before you create the PR, please make sure you have:

Workflow

Please avoid rebasing and force-pushing to the branch of the PR once a review is in progress. Rebasing can make your commits look a bit cleaner, but it also makes life more difficult from the reviewer, because they are no longer able to distinguish between code that has already been reviewed, and unreviewed code.

cadnce commented 8 months ago

Nice. LGTM!

mpenkov commented 7 months ago

@ThosRTanner Could you please enable maintainer edits for this PR?

ThosRTanner commented 7 months ago

@mpenkov According to my browser, it is enabled

mpenkov commented 7 months ago

OK, thank you!