|
2 | 2 | from ..utils import DataikuUTF8CSVReader |
3 | 3 | from ..utils import DataikuStreamedHttpUTF8CSVReader |
4 | 4 | import json |
| 5 | +from requests import utils |
5 | 6 | from .metrics import ComputedMetrics |
6 | 7 | from .future import DSSFuture |
7 | 8 | from .discussion import DSSObjectDiscussions |
@@ -81,25 +82,25 @@ def get_file(self, path): |
81 | 82 | the file's content, as a stream |
82 | 83 | """ |
83 | 84 | return self.client._perform_raw( |
84 | | - "GET", "/projects/%s/managedfolders/%s/contents/%s" % (self.project_key, self.odb_id, path)) |
| 85 | + "GET", "/projects/%s/managedfolders/%s/contents/%s" % (self.project_key, self.odb_id, utils.quote(path))) |
85 | 86 |
|
86 | 87 | def delete_file(self, path): |
87 | 88 | """ |
88 | 89 | Delete a file from the managed folder |
89 | 90 | """ |
90 | 91 | return self.client._perform_empty( |
91 | | - "DELETE", "/projects/%s/managedfolders/%s/contents/%s" % (self.project_key, self.odb_id, path)) |
| 92 | + "DELETE", "/projects/%s/managedfolders/%s/contents/%s" % (self.project_key, self.odb_id, utils.quote(path))) |
92 | 93 |
|
93 | 94 | def put_file(self, path, f): |
94 | 95 | """ |
95 | | - Upload a file to the managed folder |
| 96 | + Upload the file to the managed folder |
96 | 97 | |
97 | 98 | Args: |
98 | 99 | f: the file contents, as a stream |
99 | 100 | path: the path of the file |
100 | 101 | """ |
101 | 102 | return self.client._perform_json_upload( |
102 | | - "POST", "/projects/%s/managedfolders/%s/contents/%s" % (self.project_key, self.odb_id, path), |
| 103 | + "POST", "/projects/%s/managedfolders/%s/contents/%s" % (self.project_key, self.odb_id, utils.quote(path)), |
103 | 104 | path, f) |
104 | 105 |
|
105 | 106 | ######################################################## |
|
0 commit comments