From bcd7816a420e113509e3e6fde59b3ed0d7a0c746 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 7 Apr 2010 20:28:24 +0000 Subject: - Replace the statement ``path = path.rstrip('/').lstrip('/')`` with the simpler ``path = path.strip('/')`` in the ``repoze.bfg.traversal.traversal_path`` function. --- CHANGES.txt | 7 +++++++ repoze/bfg/traversal.py | 3 +-- 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 -- cgit v1.2.3