diff --git a/libpathod/rparse.py b/libpathod/rparse.py index e71265eac..9d0f7e794 100644 --- a/libpathod/rparse.py +++ b/libpathod/rparse.py @@ -165,7 +165,7 @@ class FileGenerator: class _Value: def __init__(self, val): - self.val = val + self.val = val.decode("string_escape") def get_generator(self, settings): return LiteralGenerator(self.val) diff --git a/test/test_rparse.py b/test/test_rparse.py index dfc8c7589..11c831c64 100644 --- a/test/test_rparse.py +++ b/test/test_rparse.py @@ -40,7 +40,11 @@ class TestMisc: def test_valueliteral(self): v = rparse.ValueLiteral("foo") assert v.expr() - assert str(v) + assert v.val == "foo" + + v = rparse.ValueLiteral(r"foo\n") + assert v.expr() + assert v.val == "foo\n" def test_valuenakedliteral(self): v = rparse.ValueNakedLiteral("foo")