Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
180d266a
Commit
180d266a
authored
Mar 27, 2018
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disallow using strings as addresses on Windows. Fixes #106.
No specific test case, though.
parent
23a5cf0f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
2 deletions
+12
-2
CHANGES.rst
CHANGES.rst
+4
-0
src/ZEO/ClientStorage.py
src/ZEO/ClientStorage.py
+3
-0
src/ZEO/_compat.py
src/ZEO/_compat.py
+1
-0
src/ZEO/tests/forker.py
src/ZEO/tests/forker.py
+2
-1
src/ZEO/tests/testZEO.py
src/ZEO/tests/testZEO.py
+2
-1
No files found.
CHANGES.rst
View file @
180d266a
...
@@ -7,6 +7,10 @@ Changelog
...
@@ -7,6 +7,10 @@ Changelog
- Fix ``ZEO.server`` relying on test dependencies. See `issue 105
- Fix ``ZEO.server`` relying on test dependencies. See `issue 105
<https://github.com/zopefoundation/ZEO/issues/105>`_.
<https://github.com/zopefoundation/ZEO/issues/105>`_.
- Disallow passing strings as addresses to ClientStorage under Windows
because string addresses are used for unix-domain sockets, which
aren't supported on Windows. See `issue 107
<https://github.com/zopefoundation/ZEO/issues/107>`_.
5.1.2 (2018-03-27)
5.1.2 (2018-03-27)
------------------
------------------
...
...
src/ZEO/ClientStorage.py
View file @
180d266a
...
@@ -41,6 +41,7 @@ import six
...
@@ -41,6 +41,7 @@ import six
from
persistent.TimeStamp
import
TimeStamp
from
persistent.TimeStamp
import
TimeStamp
from
ZEO._compat
import
get_ident
from
ZEO._compat
import
get_ident
from
ZEO._compat
import
WIN
from
ZEO.Exceptions
import
ClientDisconnected
from
ZEO.Exceptions
import
ClientDisconnected
from
ZEO.TransactionBuffer
import
TransactionBuffer
from
ZEO.TransactionBuffer
import
TransactionBuffer
from
ZODB
import
POSException
from
ZODB
import
POSException
...
@@ -191,6 +192,8 @@ class ClientStorage(ZODB.ConflictResolution.ConflictResolvingStorage):
...
@@ -191,6 +192,8 @@ class ClientStorage(ZODB.ConflictResolution.ConflictResolvingStorage):
self
.
__name__
=
name
or
str
(
addr
)
# Standard convention for storages
self
.
__name__
=
name
or
str
(
addr
)
# Standard convention for storages
if
isinstance
(
addr
,
six
.
string_types
):
if
isinstance
(
addr
,
six
.
string_types
):
if
WIN
:
raise
ValueError
(
"Unix sockets are not available on Windows"
)
addr
=
[
addr
]
addr
=
[
addr
]
elif
(
isinstance
(
addr
,
tuple
)
and
len
(
addr
)
==
2
and
elif
(
isinstance
(
addr
,
tuple
)
and
len
(
addr
)
==
2
and
isinstance
(
addr
[
0
],
six
.
string_types
)
and
isinstance
(
addr
[
1
],
int
)):
isinstance
(
addr
[
0
],
six
.
string_types
)
and
isinstance
(
addr
[
1
],
int
)):
...
...
src/ZEO/_compat.py
View file @
180d266a
...
@@ -19,6 +19,7 @@ import platform
...
@@ -19,6 +19,7 @@ import platform
PY3
=
sys
.
version_info
[
0
]
>=
3
PY3
=
sys
.
version_info
[
0
]
>=
3
PY32
=
sys
.
version_info
[:
2
]
==
(
3
,
2
)
PY32
=
sys
.
version_info
[:
2
]
==
(
3
,
2
)
PYPY
=
getattr
(
platform
,
'python_implementation'
,
lambda
:
None
)()
==
'PyPy'
PYPY
=
getattr
(
platform
,
'python_implementation'
,
lambda
:
None
)()
==
'PyPy'
WIN
=
sys
.
platform
.
startswith
(
'win'
)
if
PY3
:
if
PY3
:
from
pickle
import
Pickler
,
Unpickler
as
_Unpickler
,
dump
,
dumps
,
loads
from
pickle
import
Pickler
,
Unpickler
as
_Unpickler
,
dump
,
dumps
,
loads
...
...
src/ZEO/tests/forker.py
View file @
180d266a
...
@@ -29,6 +29,7 @@ import six
...
@@ -29,6 +29,7 @@ import six
import
ZODB.tests.util
import
ZODB.tests.util
import
zope.testing.setupstack
import
zope.testing.setupstack
from
ZEO._compat
import
WIN
from
ZEO
import
_forker
from
ZEO
import
_forker
logger
=
logging
.
getLogger
(
'ZEO.tests.forker'
)
logger
=
logging
.
getLogger
(
'ZEO.tests.forker'
)
...
@@ -60,7 +61,7 @@ runner = _forker.runner
...
@@ -60,7 +61,7 @@ runner = _forker.runner
stop_runner
=
_forker
.
stop_runner
stop_runner
=
_forker
.
stop_runner
start_zeo_server
=
_forker
.
start_zeo_server
start_zeo_server
=
_forker
.
start_zeo_server
if
sys
.
platform
[:
3
].
lower
()
==
"win"
:
if
WIN
:
def
_quote_arg
(
s
):
def
_quote_arg
(
s
):
return
'"%s"'
%
s
return
'"%s"'
%
s
else
:
else
:
...
...
src/ZEO/tests/testZEO.py
View file @
180d266a
...
@@ -20,6 +20,7 @@ from ZEO.ClientStorage import ClientStorage
...
@@ -20,6 +20,7 @@ from ZEO.ClientStorage import ClientStorage
from
ZEO.tests
import
forker
,
Cache
,
CommitLockTests
,
ThreadTests
from
ZEO.tests
import
forker
,
Cache
,
CommitLockTests
,
ThreadTests
from
ZEO.tests
import
IterationTests
from
ZEO.tests
import
IterationTests
from
ZEO._compat
import
PY3
from
ZEO._compat
import
PY3
from
ZEO._compat
import
WIN
from
ZODB.Connection
import
TransactionMetaData
from
ZODB.Connection
import
TransactionMetaData
from
ZODB.tests
import
StorageTestBase
,
BasicStorage
,
\
from
ZODB.tests
import
StorageTestBase
,
BasicStorage
,
\
...
@@ -1583,7 +1584,7 @@ if not os.environ.get('ZEO4_SERVER'):
...
@@ -1583,7 +1584,7 @@ if not os.environ.get('ZEO4_SERVER'):
>>> conn.close(); s()
>>> conn.close(); s()
"""
"""
if
sys
.
platform
.
startswith
(
'win'
)
:
if
WIN
:
del
runzeo_logrotate_on_sigusr2
del
runzeo_logrotate_on_sigusr2
del
unix_domain_sockets
del
unix_domain_sockets
...
...
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