From a2a7faee92c711494471faec105431fe15f49bdc Mon Sep 17 00:00:00 2001 From: chentanjun <2799194073@qq.com> Date: Tue, 27 Aug 2019 14:38:03 +0800 Subject: [PATCH 1/2] fix-up the document spelling mistake --- tuf/ATTACKS.md | 2 +- tuf/developer_tool.py | 2 +- tuf/download.py | 2 +- tuf/repository_lib.py | 2 +- tuf/scripts/repo.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tuf/ATTACKS.md b/tuf/ATTACKS.md index e331ef90..10a7636e 100644 --- a/tuf/ATTACKS.md +++ b/tuf/ATTACKS.md @@ -200,7 +200,7 @@ $ python basic_client.py --repo http://localhost:8001 At this point, part of the "file1.txt" file should have been fetched. That is, up to 31 bytes of it should have been downloaded, and the rest of the maliciously -appended data ignored. If we inspect the logger, we'd disover the following: +appended data ignored. If we inspect the logger, we'd discover the following: ```Bash [2016-10-06 21:37:39,092 UTC] [tuf.download] [INFO] [_download_file:235@download.py] diff --git a/tuf/developer_tool.py b/tuf/developer_tool.py index 8629a8ae..1d519c41 100755 --- a/tuf/developer_tool.py +++ b/tuf/developer_tool.py @@ -519,7 +519,7 @@ def create_new_project(project_name, metadata_directory, location_in_repository: An optional argument to hold the "prefix" or the expected location for - the project files in the "upstream" respository. This value is only + the project files in the "upstream" repository. This value is only used to sign metadata in a way that it matches the future location of the files. diff --git a/tuf/download.py b/tuf/download.py index 8de805e3..ccf3e6cd 100755 --- a/tuf/download.py +++ b/tuf/download.py @@ -398,7 +398,7 @@ def _download_fixed_amount_of_data(response, temp_file, required_length): else: logger.debug('The average download speed has not dipped below the' - ' mimimum average download speed set in tuf.settings.py.') + ' minimum average download speed set in tuf.settings.py.') # We might have no more data to read. Check number of bytes downloaded. if not data: diff --git a/tuf/repository_lib.py b/tuf/repository_lib.py index c31ac23e..6e474eda 100755 --- a/tuf/repository_lib.py +++ b/tuf/repository_lib.py @@ -2131,7 +2131,7 @@ def create_tuf_client_directory(repository_directory, client_directory): # If the client's metadata directory does not already exist, create it and # any of its parent directories, otherwise raise an exception. An exception - # is raised to avoid accidently overwritting previous metadata. + # is raised to avoid accidentally overwritting previous metadata. try: os.makedirs(client_metadata_directory) diff --git a/tuf/scripts/repo.py b/tuf/scripts/repo.py index 6689a42b..12bb022d 100755 --- a/tuf/scripts/repo.py +++ b/tuf/scripts/repo.py @@ -112,7 +112,7 @@ in --role) to --delegatee role with specified . --delegatee: - Specify role that is targetted by delegator in --role to sign for + Specify role that is targeted by delegator in --role to sign for target files matching delegated or in revocation of trust. --terminating: From 8677b435ea34ee236e7a11114def3b9e5bc1de4c Mon Sep 17 00:00:00 2001 From: chentanjun <2799194073@qq.com> Date: Fri, 30 Aug 2019 22:14:09 +0800 Subject: [PATCH 2/2] fix-up tests package word spelling mistake Signed-off-by: chentanjun <2799194073@qq.com> --- tests/proxy_server.py | 4 ++-- tests/test_updater.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/proxy_server.py b/tests/proxy_server.py index 80be450b..3c76043c 100644 --- a/tests/proxy_server.py +++ b/tests/proxy_server.py @@ -93,7 +93,7 @@ class ThreadingHTTPServer(ThreadingMixIn, HTTPServer): daemon_threads = True def handle_error(self, request, client_address): - # surpress socket/ssl related errors + # suppress socket/ssl related errors cls, e = sys.exc_info()[:2] if cls is socket.error or cls is ssl.SSLError: pass @@ -115,7 +115,7 @@ def __init__(self, *args, **kwargs): BaseHTTPRequestHandler.__init__(self, *args, **kwargs) def log_error(self, format, *args): - # surpress "Request timed out: timeout('timed out',)" + # suppress "Request timed out: timeout('timed out',)" if isinstance(args[0], socket.timeout): return diff --git a/tests/test_updater.py b/tests/test_updater.py index f7985356..56ee9fa1 100644 --- a/tests/test_updater.py +++ b/tests/test_updater.py @@ -918,7 +918,7 @@ def test_4_refresh(self): self.repository_updater.refresh() # Second, verify that expired root metadata is not updated if - # 'unsafely_update_root_if_necessary' is explictly set to 'False'. + # 'unsafely_update_root_if_necessary' is explicitly set to 'False'. expired_date = '1960-01-01T12:00:00Z' self.repository_updater.metadata['current']['root']['expires'] = expired_date self.assertRaises(tuf.exceptions.ExpiredMetadataError, @@ -1653,7 +1653,7 @@ def test_10__targets_of_role(self): def test_10__preorder_depth_first_walk(self): - # Test that infinit loop is prevented if the target file is not found and + # Test that infinite loop is prevented if the target file is not found and # the max number of delegations is reached. valid_max_number_of_delegations = tuf.settings.MAX_NUMBER_OF_DELEGATIONS tuf.settings.MAX_NUMBER_OF_DELEGATIONS = 0