summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2010-04-07 20:28:24 +0000
committerChris McDonough <chrism@agendaless.com>2010-04-07 20:28:24 +0000
commitbcd7816a420e113509e3e6fde59b3ed0d7a0c746 (patch)
treead9deb5673722c29268c1a3b4f59d3a618d98833
parent7751dbe1f7408656ae769d28b27378bbf7ede59f (diff)
downloadpyramid-bcd7816a420e113509e3e6fde59b3ed0d7a0c746.tar.gz
pyramid-bcd7816a420e113509e3e6fde59b3ed0d7a0c746.tar.bz2
pyramid-bcd7816a420e113509e3e6fde59b3ed0d7a0c746.zip
- Replace the statement ``path = path.rstrip('/').lstrip('/')`` with
the simpler ``path = path.strip('/')`` in the ``repoze.bfg.traversal.traversal_path`` function.
-rw-r--r--CHANGES.txt7
-rw-r--r--repoze/bfg/traversal.py3
2 files changed, 8 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index fd02f07ea..cb9453b43 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -11,6 +11,13 @@ Bug Fixes
``bfg_alchemy`` application template's ``MyApp`` model was an
integer. This was incorrect. It is now a string.
+Internal
+--------
+
+- Replace the statement ``path = path.rstrip('/').lstrip('/')`` with
+ the simpler ``path = path.strip('/')`` in the
+ ``repoze.bfg.traversal.traversal_path`` function.
+
1.2 (2010-02-10)
================
diff --git a/repoze/bfg/traversal.py b/repoze/bfg/traversal.py
index bce239d3f..cf2a808e8 100644
--- a/repoze/bfg/traversal.py
+++ b/repoze/bfg/traversal.py
@@ -421,8 +421,7 @@ def traversal_path(path):
their own traversal machinery, as opposed to users
writing applications in :mod:`repoze.bfg`.
"""
- path = path.rstrip('/')
- path = path.lstrip('/')
+ path = path.strip('/')
clean = []
for segment in path.split('/'):
segment = urllib.unquote(segment) # deal with spaces in path segment