Skip to content

Commit 2727c8c

Browse files
Kaushal ShahKaushal Shah
Kaushal Shah
authored and
Kaushal Shah
committed
Added URL encoded for username and password
1 parent 3a0b376 commit 2727c8c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
name="snowcomp",
77
packages=['snowcomp'],
88
package_dir={'snowcomp': 'snowcomp'},
9-
version="1.8",
9+
version="2.0",
1010
author="kaushal28",
1111
entry_points={'console_scripts': ['snowcomp = snowcomp.__main__:main' ]},
1212
author_email="[email protected]",

snowcomp/__main__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from git import Repo
22
import xml.etree.ElementTree as ET
3-
import os, json
3+
import os, json, urllib.parse as urlencode
44

55
def get_config():
66
with open('conf.json', 'r') as conf_file:
@@ -41,6 +41,8 @@ def is_ignored(class_name, ignored):
4141
if __name__ == '__main__':
4242
try:
4343
username, password, repo_link, latest_branch, old_branch, clone_path, instance, ignore_deletions = get_config()
44+
#url encode username and password
45+
username, password = urlencode.quote_plus(username), urlencode.quote_plus(password)
4446
update_dir = os.path.join(clone_path, 'update')
4547
# If repo already exists, don't clone
4648
repository = Repo(clone_path, search_parent_directories = True) if os.path.isdir(clone_path) else Repo.clone_from(f'{repo_link[:8]}{username}:{password}@{repo_link[8:]}', clone_path)

0 commit comments

Comments
 (0)