mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Quote path for /contents API (#614)
This allows spaces and other special characters in the file path. Fixes #613.
This commit is contained in:
@@ -1252,7 +1252,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
url_parameters["ref"] = ref
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"GET",
|
||||
self.url + "/contents" + path,
|
||||
self.url + "/contents" + urllib.quote(path),
|
||||
parameters=url_parameters
|
||||
)
|
||||
if isinstance(data, list):
|
||||
@@ -1311,7 +1311,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"PUT",
|
||||
self.url + "/contents" + path,
|
||||
self.url + "/contents" + urllib.quote(path),
|
||||
input=put_parameters
|
||||
)
|
||||
|
||||
@@ -1370,7 +1370,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"PUT",
|
||||
self.url + "/contents" + path,
|
||||
self.url + "/contents" + urllib.quote(path),
|
||||
input=put_parameters
|
||||
)
|
||||
|
||||
@@ -1405,7 +1405,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"DELETE",
|
||||
self.url + "/contents" + path,
|
||||
self.url + "/contents" + urllib.quote(path),
|
||||
input=url_parameters
|
||||
)
|
||||
|
||||
@@ -1426,7 +1426,7 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
url_parameters["ref"] = ref
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"GET",
|
||||
self.url + "/contents" + path,
|
||||
self.url + "/contents" + urllib.quote(path),
|
||||
parameters=url_parameters
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user