Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zodburi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
zodburi
Commits
1688e10b
Commit
1688e10b
authored
Oct 17, 2017
by
Tres Seaver
Committed by
GitHub
Oct 17, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20 from navytux/y/zeo-ipv6
zeo: Fix parsing URI with IPv6 address
parents
71fb5f10
a3b501ce
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
9 deletions
+24
-9
CHANGES.txt
CHANGES.txt
+2
-0
CONTRIBUTORS.txt
CONTRIBUTORS.txt
+1
-0
zodburi/resolvers.py
zodburi/resolvers.py
+7
-9
zodburi/tests/test_resolvers.py
zodburi/tests/test_resolvers.py
+14
-0
No files found.
CHANGES.txt
View file @
1688e10b
...
...
@@ -8,6 +8,8 @@
- Add support for Python 3.6.
- Fix parsing of ``zeo://`` URI with IPv6 address.
2.2.2 (2017-05-05)
------------------
...
...
CONTRIBUTORS.txt
View file @
1688e10b
...
...
@@ -102,3 +102,4 @@ Contributors
- Steve Piercy, 2016/07/21
- Todd Koym, 2016/07/21
- Jim Fulton, 2017/04/13
- Kirill Smelkov, 2017/10/17
zodburi/resolvers.py
View file @
1688e10b
...
...
@@ -134,21 +134,19 @@ class ClientStorageURIResolver(Resolver):
# urlsplit doesnt understand zeo URLs so force to something that
# doesn't break
uri
=
uri
.
replace
(
'zeo://'
,
'http://'
,
1
)
(
scheme
,
netloc
,
path
,
query
,
frag
)
=
urlsplit
(
uri
)
if
netloc
:
u
=
urlsplit
(
uri
)
if
u
.
netloc
:
# TCP URL
if
':'
in
netloc
:
host
,
port
=
netloc
.
split
(
':'
)
port
=
int
(
port
)
else
:
host
=
netloc
host
=
u
.
hostname
port
=
u
.
port
if
port
is
None
:
port
=
9991
args
=
((
host
,
port
),)
else
:
# Unix domain socket URL
path
=
os
.
path
.
normpath
(
path
)
path
=
os
.
path
.
normpath
(
u
.
path
)
args
=
(
path
,)
kw
=
dict
(
parse_qsl
(
query
))
kw
=
dict
(
parse_qsl
(
u
.
query
))
kw
,
unused
=
self
.
interpret_kwargs
(
kw
)
if
'demostorage'
in
kw
:
kw
.
pop
(
'demostorage'
)
...
...
zodburi/tests/test_resolvers.py
View file @
1688e10b
...
...
@@ -252,6 +252,20 @@ class TestClientStorageURIResolver(unittest.TestCase):
factory
()
ClientStorage
.
assert_called_once_with
((
'localhost'
,
8080
),
debug
=
1
)
@
mock
.
patch
(
'zodburi.resolvers.ClientStorage'
)
def
test_call_ipv6_no_port
(
self
,
ClientStorage
):
resolver
=
self
.
_makeOne
()
factory
,
dbkw
=
resolver
(
'zeo://[::1]?debug=true'
)
factory
()
ClientStorage
.
assert_called_once_with
((
'::1'
,
9991
),
debug
=
1
)
@
mock
.
patch
(
'zodburi.resolvers.ClientStorage'
)
def
test_call_ipv6
(
self
,
ClientStorage
):
resolver
=
self
.
_makeOne
()
factory
,
dbkw
=
resolver
(
'zeo://[::1]:9090?debug=true'
)
factory
()
ClientStorage
.
assert_called_once_with
((
'::1'
,
9090
),
debug
=
1
)
@
mock
.
patch
(
'zodburi.resolvers.ClientStorage'
)
def
test_call_unix
(
self
,
ClientStorage
):
resolver
=
self
.
_makeOne
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment