Revert changes accidentally made to path parsing

This commit is contained in:
Sean Gillies 2019-09-30 14:31:47 -06:00
parent 5313d4ce67
commit 371daa2d06
3 changed files with 2 additions and 12 deletions

View File

@ -133,12 +133,9 @@ def parse_path(path):
else:
parts = urlparse(path)
if not parts.scheme:
return UnparsedPath(path)
# if the scheme is not one of Rasterio's supported schemes, we
# return an UnparsedPath.
elif parts.scheme and not all(p in SCHEMES for p in parts.scheme.split('+')):
if parts.scheme and not all(p in SCHEMES for p in parts.scheme.split('+')):
return UnparsedPath(path)
else:

View File

@ -74,7 +74,7 @@ def test_create_mask_windowed_internal(data):
with rasterio.open(str(data.join('RGB.byte.tif')), 'r+') as dst:
for ij, window in dst.block_windows():
blue = dst.read(1, window=window, masked=False)
mask = 255 * (blue == 0).astype('uint8')
mask = (blue != 0)
dst.write_mask(mask, window=window)

View File

@ -67,7 +67,6 @@ def test_parse_path_file_scheme():
def test_parse_path_file():
"""Correctly parse an ordinary filesystem path"""
parsed = parse_path('/foo.tif')
assert isinstance(parsed, UnparsedPath)
assert parsed.path == '/foo.tif'
@ -165,9 +164,3 @@ def test_vsi_path_zip_plus_https():
"""A zip+https:// URLs vsi path is correct (see #1151)"""
url = 'zip+https://example.com/foo.zip!bar.tif'
assert vsi_path(parse_path(url)) == '/vsizip/vsicurl/https://example.com/foo.zip/bar.tif'
def test_sentinel2_l1c():
"""A Sentinel 2 L1C identifier is not parsed"""
path = "SENTINEL2_L1C:S2A_OPER_MTD_SAFL1C_PDMC_20150818T101440_R022_V20150813T102406_20150813T102406.xml:10m:EPSG_32632"
assert isinstance(parse_path(path), UnparsedPath)