Mercurial > hgrepos > Python > libs > data-schema
comparison data_schema/util.py @ 27:88ee7d1cc0bb
FIX: documentation of util.get_data_stream(): the returned value must support the context manager protocol
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sat, 08 Jul 2023 12:26:44 +0200 |
| parents | 0ef7141030ca |
| children | 68286d27f27d |
comparison
equal
deleted
inserted
replaced
| 26:0ef7141030ca | 27:88ee7d1cc0bb |
|---|---|
| 42 | 42 |
| 43 "file:" URIs are resolved by prepending `basedir` to the URI path. | 43 "file:" URIs are resolved by prepending `basedir` to the URI path. |
| 44 | 44 |
| 45 "data:" URIs are resolve within "<basepackage>.<packagesubdir>". | 45 "data:" URIs are resolve within "<basepackage>.<packagesubdir>". |
| 46 | 46 |
| 47 The returned stream needs to be closed as usual. | 47 The returned stream must support the context manager protocol. |
| 48 | 48 |
| 49 """ | 49 """ |
| 50 u = rfc3986.URIReference.from_string(uri).normalize() | 50 u = rfc3986.URIReference.from_string(uri).normalize() |
| 51 if u.scheme == "data": | 51 if u.scheme == "data": |
| 52 if u.authority or u.query or u.fragment: | 52 if u.authority or u.query or u.fragment: |
