Skip to content

Commit

Permalink
Merge branch '0.18'
Browse files Browse the repository at this point in the history
Conflicts:
	CHANGES.txt
	aiohttp/__init__.py
  • Loading branch information
asvetlov committed Nov 13, 2015
2 parents 65fa0c4 + 8dd0a22 commit fbc1d77
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
0.18.4 (13-11-2015)
-------------------

- Relax rule for router names again by adding dash to allowed
characters: they may contain identifiers, dashes, dots and columns

0.18.3 (25-10-2015)
-------------------

Expand Down
8 changes: 4 additions & 4 deletions aiohttp/web_urldispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ class UrlDispatcher(AbstractRouter, collections.abc.Mapping):
r'^\{(?P<var>[a-zA-Z][_a-zA-Z0-9]*):(?P<re>.+)\}$')
GOOD = r'[^{}/]+'
ROUTE_RE = re.compile(r'(\{[_a-zA-Z][^{}]*(?:\{[^{}]*\}[^{}]*)*\})')
NAME_SPLIT_RE = re.compile('[.:]')
NAME_SPLIT_RE = re.compile('[.:-]')

METHODS = {hdrs.METH_ANY, hdrs.METH_POST,
hdrs.METH_GET, hdrs.METH_PUT, hdrs.METH_DELETE,
Expand Down Expand Up @@ -456,10 +456,10 @@ def register_route(self, route):
parts = self.NAME_SPLIT_RE.split(name)
for part in parts:
if not part.isidentifier() or keyword.iskeyword(part):
raise ValueError('Incorrect route name value, '
'Route name should be a sequence of '
raise ValueError('Incorrect route name {!r}, '
'the name should be a sequence of '
'python identifiers separated '
'by dot or column')
'by dash, dot or column'.format(name))
if name in self._routes:
raise ValueError('Duplicate {!r}, '
'already handled by {!r}'
Expand Down
2 changes: 1 addition & 1 deletion tests/test_urldispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test_register_route_checks(self):
route = PlainRoute('GET', handler, 'return', '/handler/to/path')
self.assertRaises(ValueError, self.router.register_route, route)

route = PlainRoute('GET', handler, 'test.test:test',
route = PlainRoute('GET', handler, 'test.test:test-test',
'/handler/to/path')
self.router.register_route(route)

Expand Down

0 comments on commit fbc1d77

Please sign in to comment.