We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
aws cloudformation prints S3 upload progress to STDOUT
When running `aws cloudformation package`, the output must not include the S3 upload progress.

It currently includes the combined output of the S3 file upload as well as packaged CloudFormation itself making it impossible to use via STDOUT.

See the full repro at https://github.com/dnagir/cf-package-stdout-messed-up

Workaround - use `--output-template-file` option.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `awscli/customizations/s3uploader.py`
Content:
```
1 # Copyright 2012-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"). You
4 # may not use this file except in compliance with the License. A copy of
5 # the License is located at
6 #
7 # http://aws.amazon.com/apache2.0/
8 #
9 # or in the "license" file accompanying this file. This file is
10 # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11 # ANY KIND, either express or implied. See the License for the specific
12 # language governing permissions and limitations under the License.
13 
14 import hashlib
15 import logging
16 import threading
17 import os
18 import sys
19 
20 import botocore
21 import botocore.exceptions
22 from s3transfer.manager import TransferManager
23 from s3transfer.subscribers import BaseSubscriber
24 
25 from awscli.compat import collections_abc
26 
27 LOG = logging.getLogger(__name__)
28 
29 
30 class NoSuchBucketError(Exception):
31     def __init__(self, **kwargs):
32         msg = self.fmt.format(**kwargs)
33         Exception.__init__(self, msg)
34         self.kwargs = kwargs
35 
36 
37     fmt = ("S3 Bucket does not exist. "
38            "Execute the command to create a new bucket"
39            "\n"
40            "aws s3 mb s3://{bucket_name}")
41 
42 
43 class S3Uploader(object):
44     """
45     Class to upload objects to S3 bucket that use versioning. If bucket
46     does not already use versioning, this class will turn on versioning.
47     """
48 
49     @property
50     def artifact_metadata(self):
51         """
52         Metadata to attach to the object(s) uploaded by the uploader.
53         """
54         return self._artifact_metadata
55 
56     @artifact_metadata.setter
57     def artifact_metadata(self, val):
58         if val is not None and not isinstance(val, collections_abc.Mapping):
59             raise TypeError("Artifact metadata should be in dict type")
60         self._artifact_metadata = val
61 
62     def __init__(self, s3_client,
63                  bucket_name,
64                  prefix=None,
65                  kms_key_id=None,
66                  force_upload=False,
67                  transfer_manager=None):
68         self.bucket_name = bucket_name
69         self.prefix = prefix
70         self.kms_key_id = kms_key_id or None
71         self.force_upload = force_upload
72         self.s3 = s3_client
73 
74         self.transfer_manager = transfer_manager
75         if not transfer_manager:
76             self.transfer_manager = TransferManager(self.s3)
77 
78         self._artifact_metadata = None
79 
80     def upload(self, file_name, remote_path):
81         """
82         Uploads given file to S3
83         :param file_name: Path to the file that will be uploaded
84         :param remote_path:  be uploaded
85         :return: VersionId of the latest upload
86         """
87 
88         if self.prefix and len(self.prefix) > 0:
89             remote_path = "{0}/{1}".format(self.prefix, remote_path)
90 
91         # Check if a file with same data exists
92         if not self.force_upload and self.file_exists(remote_path):
93             LOG.debug("File with same data already exists at {0}. "
94                       "Skipping upload".format(remote_path))
95             return self.make_url(remote_path)
96 
97         try:
98 
99             # Default to regular server-side encryption unless customer has
100             # specified their own KMS keys
101             additional_args = {
102                 "ServerSideEncryption": "AES256"
103             }
104 
105             if self.kms_key_id:
106                 additional_args["ServerSideEncryption"] = "aws:kms"
107                 additional_args["SSEKMSKeyId"] = self.kms_key_id
108 
109             if self.artifact_metadata:
110                 additional_args["Metadata"] = self.artifact_metadata
111 
112             print_progress_callback = \
113                 ProgressPercentage(file_name, remote_path)
114             future = self.transfer_manager.upload(file_name,
115                                                   self.bucket_name,
116                                                   remote_path,
117                                                   additional_args,
118                                                   [print_progress_callback])
119             future.result()
120 
121             return self.make_url(remote_path)
122 
123         except botocore.exceptions.ClientError as ex:
124             error_code = ex.response["Error"]["Code"]
125             if error_code == "NoSuchBucket":
126                 raise NoSuchBucketError(bucket_name=self.bucket_name)
127             raise ex
128 
129     def upload_with_dedup(self, file_name, extension=None):
130         """
131         Makes and returns name of the S3 object based on the file's MD5 sum
132 
133         :param file_name: file to upload
134         :param extension: String of file extension to append to the object
135         :return: S3 URL of the uploaded object
136         """
137 
138         # This construction of remote_path is critical to preventing duplicate
139         # uploads of same object. Uploader will check if the file exists in S3
140         # and re-upload only if necessary. So the template points to same file
141         # in multiple places, this will upload only once
142 
143         filemd5 = self.file_checksum(file_name)
144         remote_path = filemd5
145         if extension:
146             remote_path = remote_path + "." + extension
147 
148         return self.upload(file_name, remote_path)
149 
150     def file_exists(self, remote_path):
151         """
152         Check if the file we are trying to upload already exists in S3
153 
154         :param remote_path:
155         :return: True, if file exists. False, otherwise
156         """
157 
158         try:
159             # Find the object that matches this ETag
160             self.s3.head_object(
161                 Bucket=self.bucket_name, Key=remote_path)
162             return True
163         except botocore.exceptions.ClientError:
164             # Either File does not exist or we are unable to get
165             # this information.
166             return False
167 
168     def make_url(self, obj_path):
169         return "s3://{0}/{1}".format(
170             self.bucket_name, obj_path)
171 
172     def file_checksum(self, file_name):
173 
174         with open(file_name, "rb") as file_handle:
175             md5 = hashlib.md5()
176             # Read file in chunks of 4096 bytes
177             block_size = 4096
178 
179             # Save current cursor position and reset cursor to start of file
180             curpos = file_handle.tell()
181             file_handle.seek(0)
182 
183             buf = file_handle.read(block_size)
184             while len(buf) > 0:
185                 md5.update(buf)
186                 buf = file_handle.read(block_size)
187 
188             # Restore file cursor's position
189             file_handle.seek(curpos)
190 
191             return md5.hexdigest()
192 
193     def to_path_style_s3_url(self, key, version=None):
194         """
195             This link describes the format of Path Style URLs
196             http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro
197         """
198         base = self.s3.meta.endpoint_url
199         result = "{0}/{1}/{2}".format(base, self.bucket_name, key)
200         if version:
201             result = "{0}?versionId={1}".format(result, version)
202 
203         return result
204 
205 
206 class ProgressPercentage(BaseSubscriber):
207     # This class was copied directly from S3Transfer docs
208 
209     def __init__(self, filename, remote_path):
210         self._filename = filename
211         self._remote_path = remote_path
212         self._size = float(os.path.getsize(filename))
213         self._seen_so_far = 0
214         self._lock = threading.Lock()
215 
216     def on_progress(self, future, bytes_transferred, **kwargs):
217 
218         # To simplify we'll assume this is hooked up
219         # to a single filename.
220         with self._lock:
221             self._seen_so_far += bytes_transferred
222             percentage = (self._seen_so_far / self._size) * 100
223             sys.stdout.write(
224                     "\rUploading to %s  %s / %s  (%.2f%%)" %
225                     (self._remote_path, self._seen_so_far,
226                      self._size, percentage))
227             sys.stdout.flush()
228
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/awscli/customizations/s3uploader.py b/awscli/customizations/s3uploader.py
--- a/awscli/customizations/s3uploader.py
+++ b/awscli/customizations/s3uploader.py
@@ -220,8 +220,8 @@
         with self._lock:
             self._seen_so_far += bytes_transferred
             percentage = (self._seen_so_far / self._size) * 100
-            sys.stdout.write(
+            sys.stderr.write(
                     "\rUploading to %s  %s / %s  (%.2f%%)" %
                     (self._remote_path, self._seen_so_far,
                      self._size, percentage))
-            sys.stdout.flush()
+            sys.stderr.flush()

{"golden_diff": "diff --git a/awscli/customizations/s3uploader.py b/awscli/customizations/s3uploader.py\n--- a/awscli/customizations/s3uploader.py\n+++ b/awscli/customizations/s3uploader.py\n@@ -220,8 +220,8 @@\n         with self._lock:\n             self._seen_so_far += bytes_transferred\n             percentage = (self._seen_so_far / self._size) * 100\n-            sys.stdout.write(\n+            sys.stderr.write(\n                     \"\\rUploading to %s  %s / %s  (%.2f%%)\" %\n                     (self._remote_path, self._seen_so_far,\n                      self._size, percentage))\n-            sys.stdout.flush()\n+            sys.stderr.flush()\n", "issue": "aws cloudformation prints S3 upload progress to STDOUT\nWhen running `aws cloudformation package`, the output must not include the S3 upload progress.\r\n\r\nIt currently includes the combined output of the S3 file upload as well as packaged CloudFormation itself making it impossible to use via STDOUT.\r\n\r\nSee the full repro at https://github.com/dnagir/cf-package-stdout-messed-up\r\n\r\nWorkaround - use `--output-template-file` option.\n", "before_files": [{"content": "# Copyright 2012-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in the \"license\" file accompanying this file. This file is\n# distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n# ANY KIND, either express or implied. See the License for the specific\n# language governing permissions and limitations under the License.\n\nimport hashlib\nimport logging\nimport threading\nimport os\nimport sys\n\nimport botocore\nimport botocore.exceptions\nfrom s3transfer.manager import TransferManager\nfrom s3transfer.subscribers import BaseSubscriber\n\nfrom awscli.compat import collections_abc\n\nLOG = logging.getLogger(__name__)\n\n\nclass NoSuchBucketError(Exception):\n    def __init__(self, **kwargs):\n        msg = self.fmt.format(**kwargs)\n        Exception.__init__(self, msg)\n        self.kwargs = kwargs\n\n\n    fmt = (\"S3 Bucket does not exist. \"\n           \"Execute the command to create a new bucket\"\n           \"\\n\"\n           \"aws s3 mb s3://{bucket_name}\")\n\n\nclass S3Uploader(object):\n    \"\"\"\n    Class to upload objects to S3 bucket that use versioning. If bucket\n    does not already use versioning, this class will turn on versioning.\n    \"\"\"\n\n    @property\n    def artifact_metadata(self):\n        \"\"\"\n        Metadata to attach to the object(s) uploaded by the uploader.\n        \"\"\"\n        return self._artifact_metadata\n\n    @artifact_metadata.setter\n    def artifact_metadata(self, val):\n        if val is not None and not isinstance(val, collections_abc.Mapping):\n            raise TypeError(\"Artifact metadata should be in dict type\")\n        self._artifact_metadata = val\n\n    def __init__(self, s3_client,\n                 bucket_name,\n                 prefix=None,\n                 kms_key_id=None,\n                 force_upload=False,\n                 transfer_manager=None):\n        self.bucket_name = bucket_name\n        self.prefix = prefix\n        self.kms_key_id = kms_key_id or None\n        self.force_upload = force_upload\n        self.s3 = s3_client\n\n        self.transfer_manager = transfer_manager\n        if not transfer_manager:\n            self.transfer_manager = TransferManager(self.s3)\n\n        self._artifact_metadata = None\n\n    def upload(self, file_name, remote_path):\n        \"\"\"\n        Uploads given file to S3\n        :param file_name: Path to the file that will be uploaded\n        :param remote_path:  be uploaded\n        :return: VersionId of the latest upload\n        \"\"\"\n\n        if self.prefix and len(self.prefix) > 0:\n            remote_path = \"{0}/{1}\".format(self.prefix, remote_path)\n\n        # Check if a file with same data exists\n        if not self.force_upload and self.file_exists(remote_path):\n            LOG.debug(\"File with same data already exists at {0}. \"\n                      \"Skipping upload\".format(remote_path))\n            return self.make_url(remote_path)\n\n        try:\n\n            # Default to regular server-side encryption unless customer has\n            # specified their own KMS keys\n            additional_args = {\n                \"ServerSideEncryption\": \"AES256\"\n            }\n\n            if self.kms_key_id:\n                additional_args[\"ServerSideEncryption\"] = \"aws:kms\"\n                additional_args[\"SSEKMSKeyId\"] = self.kms_key_id\n\n            if self.artifact_metadata:\n                additional_args[\"Metadata\"] = self.artifact_metadata\n\n            print_progress_callback = \\\n                ProgressPercentage(file_name, remote_path)\n            future = self.transfer_manager.upload(file_name,\n                                                  self.bucket_name,\n                                                  remote_path,\n                                                  additional_args,\n                                                  [print_progress_callback])\n            future.result()\n\n            return self.make_url(remote_path)\n\n        except botocore.exceptions.ClientError as ex:\n            error_code = ex.response[\"Error\"][\"Code\"]\n            if error_code == \"NoSuchBucket\":\n                raise NoSuchBucketError(bucket_name=self.bucket_name)\n            raise ex\n\n    def upload_with_dedup(self, file_name, extension=None):\n        \"\"\"\n        Makes and returns name of the S3 object based on the file's MD5 sum\n\n        :param file_name: file to upload\n        :param extension: String of file extension to append to the object\n        :return: S3 URL of the uploaded object\n        \"\"\"\n\n        # This construction of remote_path is critical to preventing duplicate\n        # uploads of same object. Uploader will check if the file exists in S3\n        # and re-upload only if necessary. So the template points to same file\n        # in multiple places, this will upload only once\n\n        filemd5 = self.file_checksum(file_name)\n        remote_path = filemd5\n        if extension:\n            remote_path = remote_path + \".\" + extension\n\n        return self.upload(file_name, remote_path)\n\n    def file_exists(self, remote_path):\n        \"\"\"\n        Check if the file we are trying to upload already exists in S3\n\n        :param remote_path:\n        :return: True, if file exists. False, otherwise\n        \"\"\"\n\n        try:\n            # Find the object that matches this ETag\n            self.s3.head_object(\n                Bucket=self.bucket_name, Key=remote_path)\n            return True\n        except botocore.exceptions.ClientError:\n            # Either File does not exist or we are unable to get\n            # this information.\n            return False\n\n    def make_url(self, obj_path):\n        return \"s3://{0}/{1}\".format(\n            self.bucket_name, obj_path)\n\n    def file_checksum(self, file_name):\n\n        with open(file_name, \"rb\") as file_handle:\n            md5 = hashlib.md5()\n            # Read file in chunks of 4096 bytes\n            block_size = 4096\n\n            # Save current cursor position and reset cursor to start of file\n            curpos = file_handle.tell()\n            file_handle.seek(0)\n\n            buf = file_handle.read(block_size)\n            while len(buf) > 0:\n                md5.update(buf)\n                buf = file_handle.read(block_size)\n\n            # Restore file cursor's position\n            file_handle.seek(curpos)\n\n            return md5.hexdigest()\n\n    def to_path_style_s3_url(self, key, version=None):\n        \"\"\"\n            This link describes the format of Path Style URLs\n            http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro\n        \"\"\"\n        base = self.s3.meta.endpoint_url\n        result = \"{0}/{1}/{2}\".format(base, self.bucket_name, key)\n        if version:\n            result = \"{0}?versionId={1}\".format(result, version)\n\n        return result\n\n\nclass ProgressPercentage(BaseSubscriber):\n    # This class was copied directly from S3Transfer docs\n\n    def __init__(self, filename, remote_path):\n        self._filename = filename\n        self._remote_path = remote_path\n        self._size = float(os.path.getsize(filename))\n        self._seen_so_far = 0\n        self._lock = threading.Lock()\n\n    def on_progress(self, future, bytes_transferred, **kwargs):\n\n        # To simplify we'll assume this is hooked up\n        # to a single filename.\n        with self._lock:\n            self._seen_so_far += bytes_transferred\n            percentage = (self._seen_so_far / self._size) * 100\n            sys.stdout.write(\n                    \"\\rUploading to %s  %s / %s  (%.2f%%)\" %\n                    (self._remote_path, self._seen_so_far,\n                     self._size, percentage))\n            sys.stdout.flush()\n", "path": "awscli/customizations/s3uploader.py"}], "after_files": [{"content": "# Copyright 2012-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in the \"license\" file accompanying this file. This file is\n# distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n# ANY KIND, either express or implied. See the License for the specific\n# language governing permissions and limitations under the License.\n\nimport hashlib\nimport logging\nimport threading\nimport os\nimport sys\n\nimport botocore\nimport botocore.exceptions\nfrom s3transfer.manager import TransferManager\nfrom s3transfer.subscribers import BaseSubscriber\n\nfrom awscli.compat import collections_abc\n\nLOG = logging.getLogger(__name__)\n\n\nclass NoSuchBucketError(Exception):\n    def __init__(self, **kwargs):\n        msg = self.fmt.format(**kwargs)\n        Exception.__init__(self, msg)\n        self.kwargs = kwargs\n\n\n    fmt = (\"S3 Bucket does not exist. \"\n           \"Execute the command to create a new bucket\"\n           \"\\n\"\n           \"aws s3 mb s3://{bucket_name}\")\n\n\nclass S3Uploader(object):\n    \"\"\"\n    Class to upload objects to S3 bucket that use versioning. If bucket\n    does not already use versioning, this class will turn on versioning.\n    \"\"\"\n\n    @property\n    def artifact_metadata(self):\n        \"\"\"\n        Metadata to attach to the object(s) uploaded by the uploader.\n        \"\"\"\n        return self._artifact_metadata\n\n    @artifact_metadata.setter\n    def artifact_metadata(self, val):\n        if val is not None and not isinstance(val, collections_abc.Mapping):\n            raise TypeError(\"Artifact metadata should be in dict type\")\n        self._artifact_metadata = val\n\n    def __init__(self, s3_client,\n                 bucket_name,\n                 prefix=None,\n                 kms_key_id=None,\n                 force_upload=False,\n                 transfer_manager=None):\n        self.bucket_name = bucket_name\n        self.prefix = prefix\n        self.kms_key_id = kms_key_id or None\n        self.force_upload = force_upload\n        self.s3 = s3_client\n\n        self.transfer_manager = transfer_manager\n        if not transfer_manager:\n            self.transfer_manager = TransferManager(self.s3)\n\n        self._artifact_metadata = None\n\n    def upload(self, file_name, remote_path):\n        \"\"\"\n        Uploads given file to S3\n        :param file_name: Path to the file that will be uploaded\n        :param remote_path:  be uploaded\n        :return: VersionId of the latest upload\n        \"\"\"\n\n        if self.prefix and len(self.prefix) > 0:\n            remote_path = \"{0}/{1}\".format(self.prefix, remote_path)\n\n        # Check if a file with same data exists\n        if not self.force_upload and self.file_exists(remote_path):\n            LOG.debug(\"File with same data already exists at {0}. \"\n                      \"Skipping upload\".format(remote_path))\n            return self.make_url(remote_path)\n\n        try:\n\n            # Default to regular server-side encryption unless customer has\n            # specified their own KMS keys\n            additional_args = {\n                \"ServerSideEncryption\": \"AES256\"\n            }\n\n            if self.kms_key_id:\n                additional_args[\"ServerSideEncryption\"] = \"aws:kms\"\n                additional_args[\"SSEKMSKeyId\"] = self.kms_key_id\n\n            if self.artifact_metadata:\n                additional_args[\"Metadata\"] = self.artifact_metadata\n\n            print_progress_callback = \\\n                ProgressPercentage(file_name, remote_path)\n            future = self.transfer_manager.upload(file_name,\n                                                  self.bucket_name,\n                                                  remote_path,\n                                                  additional_args,\n                                                  [print_progress_callback])\n            future.result()\n\n            return self.make_url(remote_path)\n\n        except botocore.exceptions.ClientError as ex:\n            error_code = ex.response[\"Error\"][\"Code\"]\n            if error_code == \"NoSuchBucket\":\n                raise NoSuchBucketError(bucket_name=self.bucket_name)\n            raise ex\n\n    def upload_with_dedup(self, file_name, extension=None):\n        \"\"\"\n        Makes and returns name of the S3 object based on the file's MD5 sum\n\n        :param file_name: file to upload\n        :param extension: String of file extension to append to the object\n        :return: S3 URL of the uploaded object\n        \"\"\"\n\n        # This construction of remote_path is critical to preventing duplicate\n        # uploads of same object. Uploader will check if the file exists in S3\n        # and re-upload only if necessary. So the template points to same file\n        # in multiple places, this will upload only once\n\n        filemd5 = self.file_checksum(file_name)\n        remote_path = filemd5\n        if extension:\n            remote_path = remote_path + \".\" + extension\n\n        return self.upload(file_name, remote_path)\n\n    def file_exists(self, remote_path):\n        \"\"\"\n        Check if the file we are trying to upload already exists in S3\n\n        :param remote_path:\n        :return: True, if file exists. False, otherwise\n        \"\"\"\n\n        try:\n            # Find the object that matches this ETag\n            self.s3.head_object(\n                Bucket=self.bucket_name, Key=remote_path)\n            return True\n        except botocore.exceptions.ClientError:\n            # Either File does not exist or we are unable to get\n            # this information.\n            return False\n\n    def make_url(self, obj_path):\n        return \"s3://{0}/{1}\".format(\n            self.bucket_name, obj_path)\n\n    def file_checksum(self, file_name):\n\n        with open(file_name, \"rb\") as file_handle:\n            md5 = hashlib.md5()\n            # Read file in chunks of 4096 bytes\n            block_size = 4096\n\n            # Save current cursor position and reset cursor to start of file\n            curpos = file_handle.tell()\n            file_handle.seek(0)\n\n            buf = file_handle.read(block_size)\n            while len(buf) > 0:\n                md5.update(buf)\n                buf = file_handle.read(block_size)\n\n            # Restore file cursor's position\n            file_handle.seek(curpos)\n\n            return md5.hexdigest()\n\n    def to_path_style_s3_url(self, key, version=None):\n        \"\"\"\n            This link describes the format of Path Style URLs\n            http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro\n        \"\"\"\n        base = self.s3.meta.endpoint_url\n        result = \"{0}/{1}/{2}\".format(base, self.bucket_name, key)\n        if version:\n            result = \"{0}?versionId={1}\".format(result, version)\n\n        return result\n\n\nclass ProgressPercentage(BaseSubscriber):\n    # This class was copied directly from S3Transfer docs\n\n    def __init__(self, filename, remote_path):\n        self._filename = filename\n        self._remote_path = remote_path\n        self._size = float(os.path.getsize(filename))\n        self._seen_so_far = 0\n        self._lock = threading.Lock()\n\n    def on_progress(self, future, bytes_transferred, **kwargs):\n\n        # To simplify we'll assume this is hooked up\n        # to a single filename.\n        with self._lock:\n            self._seen_so_far += bytes_transferred\n            percentage = (self._seen_so_far / self._size) * 100\n            sys.stderr.write(\n                    \"\\rUploading to %s  %s / %s  (%.2f%%)\" %\n                    (self._remote_path, self._seen_so_far,\n                     self._size, percentage))\n            sys.stderr.flush()\n", "path": "awscli/customizations/s3uploader.py"}]}