Use local file or FTP depending on form of URL.
(self, url)
| 1996 | return self._open_generic_http(self._https_connection, url, data) |
| 1997 | |
| 1998 | def open_file(self, url): |
| 1999 | """Use local file or FTP depending on form of URL.""" |
| 2000 | if not isinstance(url, str): |
| 2001 | raise URLError('file error: proxy support for file protocol currently not implemented') |
| 2002 | if url[:2] == '//' and url[2:3] != '/' and url[2:12].lower() != 'localhost/': |
| 2003 | raise ValueError("file:// scheme is supported only on localhost") |
| 2004 | else: |
| 2005 | return self.open_local_file(url) |
| 2006 | |
| 2007 | def open_local_file(self, url): |
| 2008 | """Use local file.""" |
nothing calls this directly
no test coverage detected