| 254 | return self.delete(url, **self._set_request_timeout(kwargs)) |
| 255 | |
| 256 | def _url(self, pathfmt, *args, **kwargs): |
| 257 | for arg in args: |
| 258 | if not isinstance(arg, str): |
| 259 | raise ValueError( |
| 260 | f'Expected a string but found {arg} ({type(arg)}) instead' |
| 261 | ) |
| 262 | |
| 263 | quote_f = partial(urllib.parse.quote, safe="/:") |
| 264 | args = map(quote_f, args) |
| 265 | |
| 266 | formatted_path = pathfmt.format(*args) |
| 267 | if kwargs.get('versioned_api', True): |
| 268 | return f'{self.base_url}/v{self._version}{formatted_path}' |
| 269 | else: |
| 270 | return f'{self.base_url}{formatted_path}' |
| 271 | |
| 272 | def _raise_for_status(self, response): |
| 273 | """Raises stored :class:`APIError`, if one occurred.""" |