format_output_location confused by intermediate hashes
PyConf.application.format_output_location
fails to append a depth specifier if the string has one 'internally':
>>> format_output_location("/Event/Tracks#1/Output)
'/Event/Tracks#1/Output'
The expected behaviour is:
>>> format_output_location("/Event/Tracks#1/Output)
'/Event/Tracks#1/Output#1'
Note the added #1
at the end.
The fix is to amend the regular expression.
diff --git a/PyConf/python/PyConf/application.py b/PyConf/python/PyConf/application.py
index 7fcf81e45..11d1f36e0 100644
--- a/PyConf/python/PyConf/application.py
+++ b/PyConf/python/PyConf/application.py
@@ -79,7 +79,7 @@ def format_output_location(l, add_depth=True):
except AttributeError:
pass
# Ensure the location ends with the depth specification `#N` or `#*`
- if add_depth and not re.match(r".*#(\d+|\*)", l):
+ if add_depth and not re.match(r".*#(\d+|\*)$", l):
l = "{}#1".format(l)
return l