From 8bd6d6c8e97c02908b1a2a211dc81eac243212e8 Mon Sep 17 00:00:00 2001 From: mercierc Date: Tue, 2 Nov 2021 11:17:59 +1300 Subject: [PATCH] Python: URI decoding: now properly checking that paths can be encoded in ASCII (issue #89) --- python/obitools3/uri/decode.pyx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/obitools3/uri/decode.pyx b/python/obitools3/uri/decode.pyx index 75036b3..db844e1 100644 --- a/python/obitools3/uri/decode.pyx +++ b/python/obitools3/uri/decode.pyx @@ -173,7 +173,10 @@ def open_uri(uri, type newviewtype=View, dms_only=False, force_file=False): - + + if not uri.isascii(): + raise Exception("Paths must be ASCII characters only") + cdef bytes urib = tobytes(uri) cdef bytes scheme cdef tuple dms