7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-09 09:12:21 +00:00

Fix parsing of weird characters in configuration parameters

This commit is contained in:
Régis Behmo 2019-07-11 10:31:23 +08:00
parent ae23637d76
commit d4a429bcc5
2 changed files with 5 additions and 1 deletions

View File

@ -22,3 +22,6 @@ class SerializeTests(unittest.TestCase):
def test_parse_list(self):
self.assertEqual(["abcd"], serialize.parse('["abcd"]'))
def test_parse_weird_chars(self):
self.assertEqual("*@google.com", serialize.parse("*@google.com"))

View File

@ -1,5 +1,6 @@
import yaml
from yaml.parser import ParserError
from yaml.scanner import ScannerError
def load(stream):
@ -16,6 +17,6 @@ def parse(v):
"""
try:
return load(v)
except ParserError:
except (ParserError, ScannerError):
pass
return v