Repository: aws/aws-cli

Issue:
Typo in SNS docs
Hi, thanks for your work :octocat: 

I found a typo in the SNS set-endpoint-attributes example (both in v1 and v2)
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sns/set-endpoint-attributes.html#examples
(get -> set)

> The following **set**-endpoint-attributes example disables the specified platform application endpoint.
aws sns **get**-endpoint-attributes \
snip...


Discussion:
Thanks for finding and reporting that, @nerixim! I can pass this on to our docs team.
Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. Because it has been longer than one year since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment to prevent automatic closure, or if the issue is already closed, please feel free to reopen it.

Resolving patch:
diff --git a/awscli/customizations/s3/comparator.py b/awscli/customizations/s3/comparator.py
--- a/awscli/customizations/s3/comparator.py
+++ b/awscli/customizations/s3/comparator.py
@@ -24,7 +24,7 @@ class Comparator(object):
     def __init__(self, file_at_src_and_dest_sync_strategy,
                  file_not_at_dest_sync_strategy,
                  file_not_at_src_sync_strategy):
-        
+
         self._sync_strategy = file_at_src_and_dest_sync_strategy
         self._not_at_dest_sync_strategy = file_not_at_dest_sync_strategy
         self._not_at_src_sync_strategy = file_not_at_src_sync_strategy
@@ -110,7 +110,7 @@ def call(self, src_files, dest_files):
                     src_take = False
                     dest_take = True
                     should_sync = self._not_at_src_sync_strategy.determine_should_sync(None, dest_file)
-                    if should_sync:                        
+                    if should_sync:
                         yield dest_file
 
             elif (not src_done) and dest_done:
@@ -122,7 +122,7 @@ def call(self, src_files, dest_files):
             elif src_done and (not dest_done):
                 dest_take = True
                 should_sync = self._not_at_src_sync_strategy.determine_should_sync(None, dest_file)
-                if should_sync:                        
+                if should_sync:
                     yield dest_file
             else:
                 break
diff --git a/awscli/customizations/s3/fileinfobuilder.py b/awscli/customizations/s3/fileinfobuilder.py
--- a/awscli/customizations/s3/fileinfobuilder.py
+++ b/awscli/customizations/s3/fileinfobuilder.py
@@ -25,12 +25,12 @@ def __init__(self, client, source_client=None,
         if source_client is not None:
             self._source_client = source_client
         self._parameters = parameters
-        self._is_stream = is_stream 
+        self._is_stream = is_stream
 
     def call(self, files):
         for file_base in files:
             file_info = self._inject_info(file_base)
-            yield file_info            
+            yield file_info
 
     def _inject_info(self, file_base):
         file_info_attr = {}
diff --git a/awscli/utils.py b/awscli/utils.py
--- a/awscli/utils.py
+++ b/awscli/utils.py
@@ -264,19 +264,16 @@ def _eat_items(value, iter_parts, part, end_char, replace_char=''):
 
 
 def _find_quote_char_in_part(part):
-    if '"' not in part and "'" not in part:
-        return
+    """
+    Returns a single or double quote character, whichever appears first in the
+    given string. None is returned if the given string doesn't have a single or
+    double quote character.
+    """
     quote_char = None
-    double_quote = part.find('"')
-    single_quote = part.find("'")
-    if double_quote >= 0 and single_quote == -1:
-        quote_char = '"'
-    elif single_quote >= 0 and double_quote == -1:
-        quote_char = "'"
-    elif double_quote < single_quote:
-        quote_char = '"'
-    elif single_quote < double_quote:
-        quote_char = "'"
+    for ch in part:
+        if ch in ('"', "'"):
+            quote_char = ch
+            break
     return quote_char
 
 


Test patch:
diff --git a/tests/unit/customizations/emr/test_create_cluster_release_label.py b/tests/unit/customizations/emr/test_create_cluster_release_label.py
--- a/tests/unit/customizations/emr/test_create_cluster_release_label.py
+++ b/tests/unit/customizations/emr/test_create_cluster_release_label.py
@@ -1324,7 +1324,7 @@ def test_instance_fleets_with_both_subnetid_subnetids_specified(self):
         self.assertEqual(expected_error_msg, result[1])
 
     def test_create_cluster_with_security_config(self):
-        cmd = (self.prefix + '--release-label emr-4.7.2 --security-configuration MySecurityConfig '+ 
+        cmd = (self.prefix + '--release-label emr-4.7.2 --security-configuration MySecurityConfig '+
                '--instance-groups ' + DEFAULT_INSTANCE_GROUPS_ARG)
         result = \
             {
diff --git a/tests/unit/customizations/s3/test_comparator.py b/tests/unit/customizations/s3/test_comparator.py
--- a/tests/unit/customizations/s3/test_comparator.py
+++ b/tests/unit/customizations/s3/test_comparator.py
@@ -117,7 +117,7 @@ def test_compare_key_greater(self):
 
         # Try when the sync strategy says to sync the file.
         self.not_at_src_sync_strategy.determine_should_sync.return_value = True
-        
+
         src_files = []
         dest_files = []
         ref_list = []