@@ -56,7 +56,7 @@ def save( # type: ignore
56
56
"""
57
57
self .branch = branch
58
58
self .commit_message = commit_message
59
- self .file_path = utils ._url_encode (self .file_path )
59
+ self .file_path = utils .EncodedId (self .file_path )
60
60
super (ProjectFile ,self ).save (** kwargs )
61
61
62
62
@exc .on_http_error (exc .GitlabDeleteError )
@@ -144,7 +144,7 @@ def create(
144
144
assert data is not None
145
145
self ._check_missing_create_attrs (data )
146
146
new_data = data .copy ()
147
- file_path = utils ._url_encode (new_data .pop ("file_path" ))
147
+ file_path = utils .EncodedId (new_data .pop ("file_path" ))
148
148
path = f"{ self .path } /{ file_path } "
149
149
server_data = self .gitlab .http_post (path ,post_data = new_data ,** kwargs )
150
150
if TYPE_CHECKING :
@@ -173,7 +173,7 @@ def update( # type: ignore
173
173
"""
174
174
new_data = new_data or {}
175
175
data = new_data .copy ()
176
- file_path = utils ._url_encode (file_path )
176
+ file_path = utils .EncodedId (file_path )
177
177
data ["file_path" ]= file_path
178
178
path = f"{ self .path } /{ file_path } "
179
179
self ._check_missing_update_attrs (data )
@@ -203,7 +203,7 @@ def delete( # type: ignore
203
203
GitlabAuthenticationError: If authentication is not correct
204
204
GitlabDeleteError: If the server cannot perform the request
205
205
"""
206
- file_path = utils ._url_encode (file_path )
206
+ file_path = utils .EncodedId (file_path )
207
207
path = f"{ self .path } /{ file_path } "
208
208
data = {"branch" :branch ,"commit_message" :commit_message }
209
209
self .gitlab .http_delete (path ,query_data = data ,** kwargs )
@@ -239,7 +239,7 @@ def raw(
239
239
Returns:
240
240
The file content
241
241
"""
242
- file_path = utils ._url_encode (file_path )
242
+ file_path = utils .EncodedId (file_path )
243
243
path = f"{ self .path } /{ file_path } /raw"
244
244
query_data = {"ref" :ref }
245
245
result = self .gitlab .http_get (
@@ -266,7 +266,7 @@ def blame(self, file_path: str, ref: str, **kwargs: Any) -> List[Dict[str, Any]]
266
266
Returns:
267
267
A list of commits/lines matching the file
268
268
"""
269
- file_path = utils ._url_encode (file_path )
269
+ file_path = utils .EncodedId (file_path )
270
270
path = f"{ self .path } /{ file_path } /blame"
271
271
query_data = {"ref" :ref }
272
272
result = self .gitlab .http_list (path ,query_data ,** kwargs )