def rfc30_1(): if version_info >= (3, 0, 0): filename = 'xx\u4E2D\u6587.\u4E2D\u6587' filename_escaped = gdaltest.urlescape(filename) else: exec("filename = u'xx\u4E2D\u6587.\u4E2D\u6587'") filename_escaped = gdaltest.urlescape(filename.encode('utf-8')) if not gdaltest.download_file( 'http://download.osgeo.org/gdal/data/gtiff/' + filename_escaped, filename): return 'skip' filename = 'tmp/cache/' + filename ds = gdal.Open(filename) file_list = ds.GetFileList() if ds is None: gdaltest.post_reason('failed to open utf filename.') return 'failure' ds = None ds = gdal.Open(file_list[0]) if ds is None: gdaltest.post_reason('failed to open utf filename (2).') return 'failure' return 'success'
def test_rfc30_1(): if version_info >= (3, 0, 0): filename = 'xx\u4E2D\u6587.\u4E2D\u6587' filename_escaped = gdaltest.urlescape(filename) else: exec("filename = u'xx\u4E2D\u6587.\u4E2D\u6587'") filename_escaped = gdaltest.urlescape(filename.encode('utf-8')) if not gdaltest.download_file( 'http://download.osgeo.org/gdal/data/gtiff/' + filename_escaped, filename): pytest.skip() filename = 'tmp/cache/' + filename ds = gdal.Open(filename) file_list = ds.GetFileList() assert ds is not None, 'failed to open utf filename.' ds = None ds = gdal.Open(file_list[0]) assert ds is not None, 'failed to open utf filename (2).'
def rfc30_1(): if version_info >= (3,0,0): filename = 'xx\u4E2D\u6587.\u4E2D\u6587' filename_escaped = gdaltest.urlescape(filename) else: exec("filename = u'xx\u4E2D\u6587.\u4E2D\u6587'") filename_escaped = gdaltest.urlescape(filename.encode( 'utf-8' )) if not gdaltest.download_file('http://download.osgeo.org/gdal/data/gtiff/' + filename_escaped, filename): return 'skip' filename = 'tmp/cache/' + filename ds = gdal.Open( filename ) file_list = ds.GetFileList() if ds is None: gdaltest.post_reason( 'failed to open utf filename.' ) return 'failure' ds = None ds = gdal.Open( file_list[0] ) if ds is None: gdaltest.post_reason( 'failed to open utf filename (2).' ) return 'failure' return 'success'
def test_rfc30_1(): if version_info >= (3, 0, 0): filename = 'xx\u4E2D\u6587.\u4E2D\u6587' filename_escaped = gdaltest.urlescape(filename) else: exec("filename = u'xx\u4E2D\u6587.\u4E2D\u6587'") filename_escaped = gdaltest.urlescape(filename.encode('utf-8')) if not gdaltest.download_file('http://download.osgeo.org/gdal/data/gtiff/' + filename_escaped, filename): pytest.skip() filename = 'tmp/cache/' + filename ds = gdal.Open(filename) file_list = ds.GetFileList() assert ds is not None, 'failed to open utf filename.' ds = None ds = gdal.Open(file_list[0]) assert ds is not None, 'failed to open utf filename (2).'