cmd/clusterctl/hack/create-local-repository.py does not work with Python 3
**What steps did you take and what happened:**
[A clear and concise description on how to REPRODUCE the bug.]

On a machine where `python` runs Python version 3.8.2:
```
$ cmd/clusterctl/hack/create-local-repository.py
Traceback (most recent call last):
  File "cmd/clusterctl/hack/create-local-repository.py", line 182, in create_dev_config
    f.write(yaml)
TypeError: a bytes-like object is required, not 'str'
```

**What did you expect to happen:**

Expected it to run without throwing a low-level error.

**Anything else you would like to add:**

On this line: https://github.com/kubernetes-sigs/cluster-api/blob/5164a1f0e2a9f4bb6c1c3ebe304877ee470ac9c5/cmd/clusterctl/hack/create-local-repository.py#L181
changing `wb` to `w` appears to get past the problem.


**Environment:**

- Cluster-api version: commit 5164a1f0e2a9f4bb6c1c3ebe304877ee470ac9c5 on master

/kind bug

 

diff --git a/cmd/clusterctl/hack/create-local-repository.py b/cmd/clusterctl/hack/create-local-repository.py
index 171f92dea..4ca3a5ab8 100755
--- a/cmd/clusterctl/hack/create-local-repository.py
+++ b/cmd/clusterctl/hack/create-local-repository.py
@@ -126,7 +126,7 @@ def write_local_repository(provider, version, components_file, components_yaml):
             if e.errno != errno.EEXIST:
                 raise
         components_path = os.path.join(provider_folder, components_file)
-        f = open(components_path, 'wb')
+        f = open(components_path, 'w')
         f.write(components_yaml)
         f.close()
 
@@ -178,7 +178,7 @@ def create_dev_config(repos):
     try:
         repository_folder = get_repository_folder()
         config_path = os.path.join(repository_folder, "config.yaml")
-        f = open(config_path, 'wb')
+        f = open(config_path, 'w')
         f.write(yaml)
         f.close()
         return components_path
['cmd/clusterctl/hack/create-local-repository.py']