aboutsummaryrefslogtreecommitdiffstats
path: root/pathod
diff options
context:
space:
mode:
Diffstat (limited to 'pathod')
-rw-r--r--pathod/language/__init__.py4
-rw-r--r--pathod/language/base.py2
-rw-r--r--pathod/language/writer.py4
3 files changed, 5 insertions, 5 deletions
diff --git a/pathod/language/__init__.py b/pathod/language/__init__.py
index 0841196e..a43424ea 100644
--- a/pathod/language/__init__.py
+++ b/pathod/language/__init__.py
@@ -31,7 +31,7 @@ def parse_pathod(s, use_http2=False):
May raise ParseException
"""
try:
- s = s.decode("ascii")
+ s.encode("ascii")
except UnicodeError:
raise exceptions.ParseException("Spec must be valid ASCII.", 0, 0)
try:
@@ -53,7 +53,7 @@ def parse_pathod(s, use_http2=False):
def parse_pathoc(s, use_http2=False):
try:
- s = s.decode("ascii")
+ s.encode("ascii")
except UnicodeError:
raise exceptions.ParseException("Spec must be valid ASCII.", 0, 0)
try:
diff --git a/pathod/language/base.py b/pathod/language/base.py
index 11ee0623..1369a3c7 100644
--- a/pathod/language/base.py
+++ b/pathod/language/base.py
@@ -226,7 +226,7 @@ class TokValueFile(Token):
return generators.FileGenerator(s)
def spec(self):
- return "<'%s'" % strutils.bytes_to_escaped_str(self.path)
+ return "<'%s'" % self.path
TokValue = pp.MatchFirst(
diff --git a/pathod/language/writer.py b/pathod/language/writer.py
index 22e32ce2..b8081989 100644
--- a/pathod/language/writer.py
+++ b/pathod/language/writer.py
@@ -22,8 +22,8 @@ def write_values(fp, vals, actions, sofar=0, blocksize=BLOCKSIZE):
"""
vals: A list of values, which may be strings or Value objects.
- actions: A list of (offset, action, arg) tuples. Action may be "pause"
- or "disconnect".
+ actions: A list of (offset, action, arg) tuples. Action may be "inject",
+ "pause" or "disconnect".
Both vals and actions are in reverse order, with the first items last.