Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/prison/utils.py: 57%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

7 statements  

1import re 

2import urllib 

3 

4 

5RE_QUOTE = re.compile('^[-A-Za-z0-9~!*()_.\',:@$/]*$') 

6 

7 

8def quote(x): 

9 if RE_QUOTE.match(x): 

10 return x 

11 

12 return urllib.quote(x.encode('utf-8'))\ 

13 .replace('%2C', ',', 'g')\ 

14 .replace('%3A', ':', 'g')\ 

15 .replace('%40', '@', 'g')\ 

16 .replace('%24', '$', 'g')\ 

17 .replace('%2F', '/', 'g')\ 

18 .replace('%20', '+', 'g')