Open a stream to a URI, similar to the built-in `open`. Args: path (str): A URI supported by this PathHandler mode (str): Specifies the mode in which the file is opened. It defaults to 'r'. buffering (int): An optional integer used
(
path: str, mode: str = "r", buffering: int = -1, **kwargs: Any
)
| 337 | |
| 338 | @staticmethod |
| 339 | def open( |
| 340 | path: str, mode: str = "r", buffering: int = -1, **kwargs: Any |
| 341 | ) -> Union[IO[str], IO[bytes]]: |
| 342 | """ |
| 343 | Open a stream to a URI, similar to the built-in `open`. |
| 344 | Args: |
| 345 | path (str): A URI supported by this PathHandler |
| 346 | mode (str): Specifies the mode in which the file is opened. It defaults |
| 347 | to 'r'. |
| 348 | buffering (int): An optional integer used to set the buffering policy. |
| 349 | Pass 0 to switch buffering off and an integer >= 1 to indicate the |
| 350 | size in bytes of a fixed-size chunk buffer. When no buffering |
| 351 | argument is given, the default buffering policy depends on the |
| 352 | underlying I/O implementation. |
| 353 | Returns: |
| 354 | file: a file-like object. |
| 355 | """ |
| 356 | return PathManager.__get_path_handler(path)._open( # type: ignore |
| 357 | path, mode, buffering=buffering, **kwargs |
| 358 | ) |
| 359 | |
| 360 | @staticmethod |
| 361 | def copy( |
no test coverage detected