diff options
author | willmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f> | 2011-01-24 14:51:56 +0000 |
---|---|---|
committer | willmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f> | 2011-01-24 14:51:56 +0000 |
commit | 40ade748fcd8529bb5ae3cb7b418608aa3e935ef (patch) | |
tree | 68ac1fbcb4dabd1999d75f3b62e61f99ba3229ac /fs/opener.py | |
parent | f03463f0712658d4be94a0bc9ac3ed064c7a5d9a (diff) | |
download | pyfilesystem-git-40ade748fcd8529bb5ae3cb7b418608aa3e935ef.tar.gz |
Fix for fs url parsing so that credentials can contain an exclamation mark
Diffstat (limited to 'fs/opener.py')
-rw-r--r-- | fs/opener.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/opener.py b/fs/opener.py index 560c581..1422822 100644 --- a/fs/opener.py +++ b/fs/opener.py @@ -119,15 +119,14 @@ class OpenerRegistry(object): :\/\/ (?: +(?:(.*?)@(.*?)) |(.*?) -|(?:(.*?)!) ) (?: !(.*?)$ )*$ -''', re.VERBOSE) - +''', re.VERBOSE) def __init__(self, openers=[]): @@ -180,8 +179,12 @@ class OpenerRegistry(object): orig_url = fs_url match = self.split_segments(fs_url) - if match: - fs_name, fs_url, _, path = match.groups() + if match: + fs_name, credentials, url1, url2, path = match.groups() + if credentials: + fs_url = '%s@%s' % (credentials, url1) + else: + fs_url = url2 path = path or '' fs_url = fs_url or '' if ':' in fs_name: |